#define sensorPin 2 // capactitive touch sensor
int ledPin = 13; // output display Led (0n board LED) - Arduino Digital pin D13
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(sensorPin, INPUT);
}
void loop() {
int senseValue = digitalRead(sensorPin);
if (senseValue == HIGH) {
digitalWrite(ledPin, HIGH);
Serial.println("TOUCHED");
}
else {
digitalWrite(ledPin, LOW);
Serial.println("not touched");
}
delay (500);
}