There was an error while loading. Please reload this page.
1 parent ec47beb commit 7cde730Copy full SHA for 7cde730
1 file changed
java/libraries/io/examples/SimpleInput/SimpleInput.pde
@@ -12,10 +12,11 @@ void setup() {
12
}
13
14
void draw() {
15
- // sense the input pin
16
- if (GPIO.digitalRead(4) == GPIO.HIGH) {
+ if (GPIO.digitalRead(4) == GPIO.LOW) {
+ // button is pressed
17
fill(255);
18
} else {
19
+ // button is not pressed
20
fill(204);
21
22
stroke(255);
0 commit comments