← index #5854PR #6408
Related · high · value 1.146
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: Expose touch_pad_get/set_meas_time() in python

openby fgervaisopened 2020-09-05updated 2024-03-07
port-esp32

The esp32 can enter deep sleep and use really little current. For example on the tinypico board I measured a current of 24 uA in deep sleep.

The esp32 also provides a touch sensor module which can be used to wake-up from deep sleep. However this module uses about 2 mA of current to do the touch detection and (by default) does it for about 4ms at 37 Hz.

This means that all these efforts to use really little power will be ruined by the touch sensor using 100 times the sleep power roughly 15% of the time.

The good news it that Espressif provides a way to customize those timings and depending on the application, the power consumption of the touch sensor can be greatly reduced.

This patch simply exposes this functionality in python.

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