Hi,
When I access GPIO from C code, only the first access goes through. Further access are basically ignored. I need to close the value file and reopen to do another access.
Everything works fine I I echo value from shell, thou
gh. So I'm not sure what is the problem ?
Below is the working C code after modyfing it to close and reopen after every access:
{
FILE *gp;
int i;
printf("Open file\n");
gp = fopen("/sys/class/gpio/gpio939/value", "w");
for ( i =0; i < 10; i++) {
fputs("0", gp);
fputs("1", gp);
fclose(gp);
}
fclose(gp);
printf("Done\n");
return 0;
}