Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bcm2835.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <stdbool.h>
- #define PIN RPI_GPIO_P1_07
- int main(int argc, char **argv){
- if (!bcm2835_init()) return 1;
- // Set the pin to input
- bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP);
- bcm2835_gpio_write(PIN,0);
- char* str = "10001110100010001000111010001000100011101000111010001110100010001000111010001110100010001000111010000000000000000000000000000000";
- for (int i = 0; i<100;i++){
- for(int j = 0; j < 128; j++){
- bcm2835_gpio_write(PIN,(uint8_t)(str[j] - 0x30));
- usleep(25);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment