0e1bb502b8aa7cf1a427db0c5b18e21ca112b172
[hdmi-switcher.git] / main.c
1 #include <stdio.h>
2 #include <wiringPi.h>
3
4 int main (void)
5 {
6 printf ("Short pin 7 and 9 to see something cool.\n") ;
7
8 wiringPiSetup ();
9
10 pinMode(7, INPUT) ;
11 pullUpDnControl(7, PUD_UP);
12
13 while(1)
14 {
15 if (digitalRead(7) == LOW) //Low is pressed
16 printf("Yay!\n");
17
18 while(digitalRead(7) == LOW) //This just causes the loop to wait til the button is released
19 delay(10);
20 }
21 }