1

I need help I use Touch Sensor(T)v.0 and it always receives a signal not matter I touched it or not. Here is the code.

#define TOUCH_PIN 7
int touchVal = 0;
  
void setup() {
   Serial.begin(115200);
   pinMode(TOUCH_PIN, INPUT);
}
  
void loop() {
   touchVal = digitalRead(TOUCH_PIN);
   Serial.println(touchVal);
   delay(200);
}
6
  • What touch sensor do you have? Please provide a link to the datasheet or to the product page at your reseller. How did you connect it? Is it active HIGH or active LOW? (meaning if touching it makes the output HIGH or LOW, both is possible) – chrisl Mar 3 at 8:19
  • Honestly, I don't know it's active HIGH or active LOW but it doesn't chengs value when I touched it always print 1 – Shushan Abovyan Mar 3 at 8:25
  • 1
    how do you know that the output is digital ? – jsotola Mar 3 at 22:07
  • why does your code not look for a change in the output? – jsotola Mar 3 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.