pi-lights/flush.c

18 lines
358 B
C
Raw Permalink Normal View History

2017-01-03 11:17:10 -05:00
#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;
}