TTP223B - touch sensor

TTP223B 1 channel - touch sensor capacitive touch switch modules Accessories for arduino


20 ₪

الناشر: متجر القطع الالكترونية

القسم: مستشعرات - سينسور

تاريخ النشر: 2021-03-28



Digital Capacitive Touch Sensor arduino Interface



Connect Vcc pin of Sensor breakout board to Arduino’s +5V pin and Gnd to Gnd. Connect Signal (SIG) pin to Arduino Digital pin D1 and Upload the following code to get response when you touch the Capacitive sensor.






Arduino Code for on board LED and Serial monitor observation.

code
نسخ
اقتباس
عرض
تنزيل
	
								
//Digital Capacitive Touch Sensor Arduino Interfacing #define sensorPin 1 // capactitive touch sensor - Arduino Digital pin D1 int ledPin = 13; // Output display LED (on board LED) - Arduino Digital pin D13 void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); pinMode(sensorPin, INPUT); } void loop() { int senseValue = digitalRead(sensorPin); if (senseValue == HIGH){ digitalWrite(ledPin, HIGH); Serial.println("TOUCHED"); } else{ digitalWrite(ledPin,LOW); Serial.println("not touched"); } delay(500); }


سلة المشتريات افراغ السلة