SHOW:
|
|
- or go back to the newest paste.
1 | #include <stdio.h> // for printf() | |
2 | #include <unistd.h> // for sleep() | |
3 | ||
4 | int main() { | |
5 | ||
6 | FILE *fp; | |
7 | char buff[8]; | |
8 | ||
9 | while(1) { | |
10 | fp = fopen("voltageP9_39", "r"); // voltageP9_39 -> /sys/bus/iio/devices/iio:device0/in_voltage0_raw | |
11 | fscanf(fp, "%s", buff); | |
12 | printf("value : %s\n", buff ); | |
13 | sleep(0.2); | |
14 | fclose(fp); | |
15 | } | |
16 | return 0; | |
17 | } |