We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 349f413 commit 2015448Copy full SHA for 2015448
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