6107 views|2 replies

1w

Posts

25

Resources
The OP
 

【ESP32 Learning】Touch Button [Copy link]

 
ESP32 supports capacitive touch button function. Its main features are: Main Features
  • Supports up to 10 capacitive touch pins/General Purpose Input and Output (GPIO)
  • Touch pins can be used in combination to cover a larger touch area or more touch points
  • Touch pin sensing is controlled by finite state machine (FSM) hardware, initiated by software or dedicated hardware timer
  • Information on whether the touch pin is touched can be obtained in the following ways:
    • Software directly checks the register of the touch sensor
    • Judgment by the interrupt signal initiated by the touch monitoring module
    • Judgment by whether the CPU on the touch monitoring module wakes up from Deep-sleep
  • Supports low-power operation in the following scenarios:
    • The CPU is in Deep-sleep energy-saving mode and will gradually wake up after being touched
    • Touch monitoring is managed by the ultra-low power coprocessor (ULP coprocessor)
Touch button pins
Touch sensor signal namePin
T0GPIO4
T1GPIO0
T2GPIO2
T3GPIO15
T4GPIO13
T5GPIO12
T6GPIO14
: T7GPIO27
T8GPIO33
T9GPIO32
Usage of touch buttons
  1. from machine import Pin, TouchPad from time import sleep_ms tc7 = TouchPad(Pin(27)) while True: sleep_ms(500) print(tc7.read())
复制代码
First, you need to define a touch button and specify the pin. Then you can read the status of the button. The return value is an integer. The value is related to the button layout, parameter settings, and button sensing. The change in the value can be used to determine whether there is a touch action, such as: It can be clearly seen from the above data that the value becomes significantly smaller when there is touch. This content is originally created by EEWORLD forum user dcexpert. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source





Latest reply

#Learn ESP32's micropython with me#Related learning materials https://en.eeworld.com/bbs/forum ... 2426&fromuid=536508 (Source: Electronic Engineering World-Forum)   Details Published on 2018-8-6 08:34
 
 

1453

Posts

18

Resources
2
 
Personally tested, using 0 pin, 700-900
Personal signaturehttp://weibo.com/u/1391449055
 
 
 

1w

Posts

204

Resources
3
 
#Learn ESP32's micropython with me#Related learning materials https://en.eeworld.com/bbs/forum ... 2426&fromuid=536508 (Source: Electronic Engineering World-Forum)
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list