nolanrfoster
Published © GPL3+

Arduino Touch Sensor

Find out how to control a led with a touch sensor

BeginnerFull instructions provided533
Arduino Touch Sensor

Things used in this project

Story

Read more

Schematics

Diagrams

Code

code

C/C++
int switchstate = 0;

void setup() {

  pinMode(3, OUTPUT);
  pinMode(2, INPUT);
}

void loop() {


  switchstate = digitalRead(2);

  if (switchstate == HIGH) {
    digitalWrite(3, HIGH); 
  }
  else {
    digitalWrite(3, LOW);  
  }
}

Credits

nolanrfoster

nolanrfoster

1 project • 0 followers

Comments