Published © LGPL

Grove Starter Kit for Arduino: Touch sensor

Teaches you how to use the touch sensor in the Arduino Grove Starter kit.

BeginnerProtip30 minutes2,394
Grove Starter Kit for Arduino: Touch sensor

Things used in this project

Hardware components

Arduino 101
Arduino 101
×1
Seeed Studio SeeedStudio grove starter kit Arduino 101
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Touch sensor setup

plug the sensor into D4

Code

Touch code

Arduino
const int TouchPin = 9;
const int ledPin = 3;
void setup() {
  pinMode(TouchPin, INPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int sensorValue = digitalRead(TouchPin);
  if (sensorValue == 1){
    digitalWrite(ledPin, HIGH);
  }
  else{
    digitalWrite(ledPin, LOW);
  }
}

Credits

Comments