Week 9. Input Devices

Overview

Input devices are devices that take in input/information send it to a microcontroller so it can process it and make decisions. There are different types of input devices that detect different things (ex: touch, temperature, distance, etc).

Input devices either give Analog (range of values) or Digital (1 or 0) signals.

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:

Group Assignment

Here is our group assignment link

Built with Hugo
Theme Stack designed by Jimmy