diff --git a/src/main.cpp b/src/main.cpp index 90d54ba..47f0989 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,7 +8,7 @@ */ #include "Arduino.h" -#define LED_PIN 5 +#define LED_PIN 6 void setup() { @@ -19,14 +19,21 @@ void setup() void loop() { // turn the LED on (HIGH is the voltage level) - digitalWrite(LED_PIN, HIGH); - - // wait for a second - delay(1000); - + if ( touchRead(T0) < 50 + || touchRead(T1) < 50 + || touchRead(T2) < 50 + || touchRead(T3) < 50 + || touchRead(T4) < 50 + || touchRead(T5) < 50 + || touchRead(T6) < 50 + || touchRead(T7) < 50 + || touchRead(T8) < 50 ) { + digitalWrite(LED_PIN, HIGH); + } else { // turn the LED off by making the voltage LOW - digitalWrite(LED_PIN, LOW); + digitalWrite(LED_PIN, LOW); + } - // wait for a second + // wait for a second delay(1000); }