Guest User

Untitled

a guest
Nov 1st, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <bcm2835.h>
  2. #include <unistd.h>
  3. #include <stdio.h>
  4. #include <stdbool.h>
  5.  
  6. #define PIN RPI_GPIO_P1_07
  7.  
  8. int main(int argc, char **argv){
  9.  
  10. if (!bcm2835_init()) return 1;
  11.  
  12. // Set the pin to input
  13. bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP);
  14.  
  15. bcm2835_gpio_write(PIN,0);
  16.  
  17. char* str = "10001110100010001000111010001000100011101000111010001110100010001000111010001110100010001000111010000000000000000000000000000000";
  18. for (int i = 0; i<100;i++){
  19. for(int j = 0; j < 128; j++){
  20. bcm2835_gpio_write(PIN,(uint8_t)(str[j] - 0x30));
  21. usleep(25);
  22. }
  23. }
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment