Description
Description
- This little sensor can “feel” people and metal touch and feedback a high/low voltage level.
- Wide voltage range from 3.3V to 5V
- Standard assembling structure (two 3mm holes with multiple of 5cm as interval)
- Easily recognitive interfaces of sensors (“A” for analog and “D” for digital)
- High quality connector
Specification
- Supply Voltage: 3.3V to 5V
- Interface: Digital
- Size:22x30mm
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
int ledPin = 13; // Connect LED on pin 13, or use the onboard one int KEY = 2; // Connect Touch sensor on Digital Pin 2 void setup(){ pinMode(ledPin, OUTPUT); // Set ledPin to output mode pinMode(KEY, INPUT); //Set touch sensor pin to input mode } void loop(){ if (digitalRead(KEY)==HIGH) { //Read Touch sensor signal digitalWrite(ledPin, HIGH); // if Touch sensor is HIGH, then turn on } else { digitalWrite(ledPin, LOW); // if Touch sensor is LOW, then turn off the led } } |
Related products
Sale!