← index #5854PR #8955
Related · high · value 4.203
QUERY · ISSUE

touchPad on Pin 2 (ESP32)

openby DaveHOnCodeopened 2020-04-01updated 2021-03-21

I have downloaded the actual version of Micropython for the ESP32 and i wanted to use Pin 2 as a touchPin. I can decelerate it as a touchpin like this touchPad = TouchPad(Pin(2))

But I cannot read from that: touchPad.read()

Than I get an error: ValueError: Touch pad error

Have anyone an idea?

CANDIDATE · PULL REQUEST

esp32: Fix TouchPad on esp32s2 and esp32s3.

mergedby Wind-stormgeropened 2022-07-24updated 2023-01-06
port-esp32

Fixed the issue that TouchPad failed on esp32s2 and esp32s3
after compiling firmware with ESP-IDF v4.4 and higher versions.

Addresses issue #8048 .

Solution proposed by this contributor https://github.com/micropython/micropython/issues/8048#issuecomment-1107432527 .

Tested with this code passed:

from machine import TouchPad, Pin
# ESP32S3 TouchPad on GPIO 1~14
t = TouchPad(Pin(i))
print(t.read())

Specific readings depend on the PCB and its peripherals.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied