Compare commits

..

No commits in common. '114bdbe5d9f6d70b2c3f1e6f10d9966b147053ad' and '761f8b63ac64aac3e567a76f6df54f620209b811' have entirely different histories.

1
.gitignore vendored

@ -1 +0,0 @@
hello

@ -6,47 +6,21 @@ int main(int argc, char *argv[]){
int fd;
// export
fd = open("/sys/class/gpio/chip0/export", O_WRONLY);
if(fd<0)
{
perror("Error opening the GPIO export path");
return -1;
}
write(fd,"17",2);
close(fd);
// pin direction
fd = open("/sys/class/gpio/chip0/gpio17/direction", O_WRONLY);
if(fd<0)
{
perror("Error opening the GPIO export path");
return -1;
}
write(fd,"out",3);
close(fd);
// pin value
fd = open("/sys/class/gpio/chip0/gpio17/value", O_WRONLY);
if(fd<0)
{
perror("Error opening the GPIO export path");
return -1;
}
write(fd,"1",1);
close(fd);
//pin
fd = open("/sys/class/gpio/chip0/gpio17/value", O_WRONLY);
if(fd<0)
{
perror("Error opening the GPIO export path");
return -1;
}
write(fd,"0",1);
close(fd);
sleep(1);
@ -54,12 +28,6 @@ int main(int argc, char *argv[]){
// unexport
fd = open("/sys/class/gpio/chip0/unexport", O_WRONLY);
if(fd<0)
{
perror("Error opening the GPIO export path");
return -1;
}
write(fd,"17",2);
close(fd);

Loading…
Cancel
Save