#include CapacitiveSensor Sensor = CapacitiveSensor(4, 6); CapacitiveSensor Sensor2 = CapacitiveSensor(9, 10); long val; long val2; int pos; #define led 7 #define speaker A5 void setup() { Serial.begin(9600); pinMode(led, OUTPUT); } void loop() { val = Sensor.capacitiveSensor(30); val2 = Sensor2.capacitiveSensor(30); Serial.println(val); if (val >= 1000) { digitalWrite(led, HIGH); pos = 1; tone (speaker,1000,100); delay(100); } else if (val < 1000) { digitalWrite(led, LOW); delay(10); } if (val2 >= 1000) { digitalWrite(led, HIGH); pos = 1; tone (speaker,600,100); delay(100); } else if (val2 < 1000) { digitalWrite(led, LOW); delay(10); } delay(10); }