Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- int main(void) {
- unsigned char byte, foo;
- FILE *GPIOMOD;
- GPIOMOD=fopen("/dev/gpiomod", "w");
- setvbuf(GPIOMOD, &foo, _IONBF, 1);
- byte=1;
- while (1) {
- printf("Byte value: %d\n", byte);
- fwrite(&byte, 1, 1, GPIOMOD);
- byte <<=1;
- if (byte == 0 ) byte = 1;
- sleep(1);
- }
- fclose(GPIOMOD);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement