pi-lights/flush.c
2017-01-03 16:17:10 +00:00

18 lines
358 B
C

#include <wiringPi.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv){
wiringPiSetup();
if(argc <= 1){
printf("No arguments\n");
return 1;
}
for(int i=1; i < argc; i++){
const int cur = atoi(argv[i]);
printf("Shutting off pin %d\n", cur);
pinMode(cur, OUTPUT);
digitalWrite(cur, LOW);
}
return 0;
}