viewing paste Unknown #25601 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <CapacitiveSensor.h>;
CapacitiveSensor capSensor = CapacitiveSensor(4,2);
int threshold = 1000;
const int ledPin = 12;
void setup(){
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}
void loop(){
  long sensorValue = capSensor.capacitiveSensor(30);
  Serial.println(sensorValue);
  if (sensorValue > threshold){
    digitalWrite(ledPin, HIGH);
    )
    else{
      digitalWrite(ledpin, LOW);
    }
    delay(10);
  }}
Viewed 604 times, submitted by unknown.