From 0b4498e5d6bcaece13d206f7e5ee9f0e8e4e474c Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 26 Jun 2018 19:11:29 -0700 Subject: [PATCH] IO: Clarify SimpleInput example As suggested by @msurguy --- java/libraries/io/examples/SimpleInput/SimpleInput.pde | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/libraries/io/examples/SimpleInput/SimpleInput.pde b/java/libraries/io/examples/SimpleInput/SimpleInput.pde index 80aa5894f..5b6f5687a 100644 --- a/java/libraries/io/examples/SimpleInput/SimpleInput.pde +++ b/java/libraries/io/examples/SimpleInput/SimpleInput.pde @@ -12,10 +12,11 @@ void setup() { } void draw() { - // sense the input pin - if (GPIO.digitalRead(4) == GPIO.HIGH) { + if (GPIO.digitalRead(4) == GPIO.LOW) { + // button is pressed fill(255); } else { + // button is not pressed fill(204); } stroke(255);