micropython 範例

讀取內建 touch 電容感測值

ESP32 內建的 touch pad 的腳位有十個,但擴充板上可拉出來用的,只剩 GPIO32/33/4 這幾根

# 範例九:

# 讀取內建 touch 電容感測值

# 使用 GPIO33

# 需要的 module :

# FB : https://www.facebook.com/mason.chen.1420


from machine import Pin

from machine import TouchPad



while True:

print((TouchPad(Pin(33, Pin.IN)).read()))