• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 Touch Sensor

Q&A Forum › Category: ESP32 › ESP32 Touch Sensor
0 Vote Up Vote Down
Billy Pruchno asked 4 years ago

Using this simple sketch 
// ESP32 Touch Test
// Just test touch pin – Touch0 is T0 which is on GPIO 4.
void setup()
{
Serial.begin(115200);
delay(1000); // give me time to bring up serial monitor
Serial.println(“ESP32 Touch Test”);
}
void loop()
{
Serial.println(touchRead(4)); // get value of Touch 0 pin = GPIO 4
delay(1000);
}
This did not appear to work when I touched GPIO 4. The sketch runs, but it mostly gives me zero’s.  I tried another touch GPIO (15) – and that produced only 1’s. 
Sorry – I am struggling with some basics.
Thanks,

  • Billy  
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
What do you mean by “mostly zeros”? Doesn’t it react to touch?
GPIO 15 is a strapping pin, which might explain the issue, but GPIO4 should work.
What is the ESP32 board model you’re using?
Regards.
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.