Go Down

Topic: How do I add more LEDs to this circuit? (hardware and code????) (Read 1 time) previous topic - next topic

samuelbaldwin2010

#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);
}

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

Go Up