TouchPad ValueError

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
moefear85
Posts: 5
Joined: Sat Oct 30, 2021 12:44 pm

TouchPad ValueError

Post by moefear85 » Fri Dec 10, 2021 10:37 pm

I'm running the following code to test TouchPad functionality:

Code: Select all

from machine import TouchPad,Pin
from time import sleep

touchPins=[0, 2, 4, 12, 13,14, 15, 27, 32, 33]
t=[]

for pin in touchPins:
    t.append(TouchPad(Pin(pin)))

while True:
    for i in t:
        try: print(i.read())
        except Exception as e: print(type(e),e.args)
    sleep(0.1)
The output is simply "ValueError: Touch pad error", for all the pins, all the time, even after resetting. I'm using an esp32-wrover and a self-built micropython version to support spiram (commit 06ada5c). Am I doing something wrong?

User avatar
Roberthh
Posts: 3668
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: TouchPad ValueError

Post by Roberthh » Sat Dec 11, 2021 7:51 am

I never tried that, but I found a note, that you have to connect a capacitor of 10nF between GPIO36, GPIO37 and 10 nF between GPIO37, GPIO39 to enable the touch function.

Post Reply