pi-lights/prompt.c

23 lines
381 B
C
Raw Permalink Normal View History

2017-01-03 11:17:10 -05:00
#include <wiringPi.h>
#include <stdio.h>
#include <stdbool.h>
void blink(int pin) {
digitalWrite (pin, HIGH);
delay (500);
digitalWrite (pin, LOW);
delay (500);
}
int main(){
wiringPiSetup();
int i;
while(true){
printf("Write pin: ");
scanf("%d", &i);
pinMode (i, OUTPUT);
printf("Blinking: (%d)\n", i);
blink(i);
blink(i);
}
return 0;
}