Week 9. Input Devices

Touch Sensor

I connected a touch sensor to the pcb i made in Week 8

Here is the touch sensor:

What to connect where:

SIG -> GPIO6 (purple wire)

VCC -> 3V3 (red wire)

GND -> GND (black wire)

Blink code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
void setup() {
  pinMode(6, INPUT);
  pinMode(2, OUTPUT);

  digitalWrite(2, LOW);
}

void loop() {
  if (digitalRead(6) == HIGH){
    digitalWrite(2, HIGH);
  }
  else{
    digitalWrite(2, LOW);
  }
}

Video:

Built with Hugo
Theme Stack designed by Jimmy