|
|
|
@ -17,12 +17,19 @@ int main(int argc, char *argv[]){
|
|
|
|
fd= open("/sys/class/gpio/chip0/gpio17/value",O_WRONLY);
|
|
|
|
fd= open("/sys/class/gpio/chip0/gpio17/value",O_WRONLY);
|
|
|
|
write(fd,"1",1);
|
|
|
|
write(fd,"1",1);
|
|
|
|
close(fd);
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
sleep(1);
|
|
|
|
|
|
|
|
//pin value
|
|
|
|
|
|
|
|
fd= open("/sys/class/gpio/chip0/gpio17/value",O_WRONLY);
|
|
|
|
|
|
|
|
write(fd,"0",1);
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
sleep(1);
|
|
|
|
|
|
|
|
|
|
|
|
//unexport
|
|
|
|
//unexport
|
|
|
|
fd= open("/sys/class/gpio/chip0/unexport",O_WRONLY);
|
|
|
|
fd= open("/sys/class/gpio/chip0/unexport",O_WRONLY);
|
|
|
|
write(fd,"17",2);
|
|
|
|
write(fd,"17",2);
|
|
|
|
close(fd);
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n");
|
|
|
|
printf("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n");
|
|
|
|
printf("Number of arguments: %d\n",argc);
|
|
|
|
printf("Number of arguments: %d\n",argc);
|
|
|
|
printf("Program is reciving: %s\n", argv[0]);
|
|
|
|
printf("Program is reciving: %s\n", argv[0]);
|
|
|
|
|