bzr branch
http://bzr.ed.am/elec/audio-switcher
1
by Tim Marston
initial commit |
1 |
|
2 |
void setup() |
|
3 |
{ |
|
4 |
pinMode( 7, INPUT ); |
|
5 |
digitalWrite( 7, HIGH ); |
|
6 |
||
7 |
pinMode( 13, OUTPUT ); |
|
8 |
} |
|
9 |
||
10 |
void loop() |
|
11 |
{ |
|
12 |
// static bool state = false; |
|
13 |
// state = !state; |
|
14 |
// delay( 1000 ); |
|
15 |
||
16 |
bool state = !digitalRead( 7 ); |
|
17 |
||
18 |
digitalWrite( 13, state? HIGH : LOW ); |
|
19 |
} |