1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
void setup()
{
pinMode( 7, INPUT );
digitalWrite( 7, HIGH );
pinMode( 13, OUTPUT );
}
void loop()
{
// static bool state = false;
// state = !state;
// delay( 1000 );
bool state = !digitalRead( 7 );
digitalWrite( 13, state? HIGH : LOW );
}
|