File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
examples/01.Basics/Interrupt Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 23
23
const byte interruptPin = 2 ;
24
24
volatile byte state = LOW;
25
25
26
- void blink () {
26
+ void blink () {
27
27
state = !state; // toggle the cached state
28
28
}
29
29
30
30
// the setup function runs once when you press reset or power the board
31
- void setup () {
31
+ void setup () {
32
32
// initialize digital pin LED_BUILTIN as an output.
33
33
pinMode (LED_BUILTIN, OUTPUT);
34
34
// initialize digital pin as input with pull-up resistor (i.e. always HIGH, unless deliberately pulled LOW)
@@ -38,7 +38,7 @@ void setup () {
38
38
}
39
39
40
40
// the loop function runs over and over again forever
41
- void loop () {
41
+ void loop () {
42
42
// update the LED to reflect the cached state updated with interrupts
43
43
digitalWrite (LED_BUILTIN, state);
44
44
}
You can’t perform that action at this time.
0 commit comments