projects
/
hdmi-switcher.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Update readme
[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
}