Browse Source

touch test

main
Hendrik Langer 8 years ago
parent
commit
6d7b1f60b4
  1. 23
      src/main.cpp

23
src/main.cpp

@ -8,7 +8,7 @@
*/ */
#include "Arduino.h" #include "Arduino.h"
#define LED_PIN 5 #define LED_PIN 6
void setup() void setup()
{ {
@ -19,14 +19,21 @@ void setup()
void loop() void loop()
{ {
// turn the LED on (HIGH is the voltage level) // turn the LED on (HIGH is the voltage level)
digitalWrite(LED_PIN, HIGH); if ( touchRead(T0) < 50
|| touchRead(T1) < 50
// wait for a second || touchRead(T2) < 50
delay(1000); || 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 // 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); delay(1000);
} }

Loading…
Cancel
Save