SHOW:
|
|
- or go back to the newest paste.
1 | #include <stdio.h> | |
2 | #include <unistd.h> | |
3 | ||
4 | int main(void) { | |
5 | unsigned char byte, foo; | |
6 | FILE *GPIOMOD; | |
7 | ||
8 | GPIOMOD=fopen("/dev/gpiomod", "w"); | |
9 | setvbuf(GPIOMOD, &foo, _IONBF, 1); | |
10 | byte=1; | |
11 | - | while (byte==64) { |
11 | + | while (1) { |
12 | printf("Byte value: %d\n", byte); | |
13 | fwrite(&byte, 1, 1, GPIOMOD); | |
14 | ||
15 | byte <<=1; | |
16 | if (byte == 0 ) byte = 1; | |
17 | sleep(1); | |
18 | } | |
19 | fclose(GPIOMOD); | |
20 | } |