error catcher tested

error-catching
Edgar Gaona 23 hours ago
parent 611d314d6b
commit a5d0616a53

1
.gitignore vendored

@ -1 +1,2 @@
hello hello
gpio

BIN
gpio

Binary file not shown.

@ -6,6 +6,10 @@ int main(int argc, char *argv[]){
int fd; int fd;
//export //export
fd= open("/sys/class/gpio/chip0/export",O_WRONLY); 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); write(fd,"17",2);
close(fd); close(fd);
//pin direction //pin direction

Loading…
Cancel
Save