Skip to content

Commit 2015448

Browse files
committed
IO: Clarify SimpleInput example
As suggested by @msurguy
1 parent 349f413 commit 2015448

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/libraries/io/examples/SimpleInput/SimpleInput.pde

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ void setup() {
1212
}
1313

1414
void draw() {
15-
// sense the input pin
16-
if (GPIO.digitalRead(4) == GPIO.HIGH) {
15+
if (GPIO.digitalRead(4) == GPIO.LOW) {
16+
// button is pressed
1717
fill(255);
1818
} else {
19+
// button is not pressed
1920
fill(204);
2021
}
2122
stroke(255);

0 commit comments

Comments
 (0)