当前位置:网站首页>Capacitive inching touch switch module control (stm32f103c8t6)
Capacitive inching touch switch module control (stm32f103c8t6)
2022-06-24 19:23:00 【Me-Space】
This experiment is controlled by capacitive touch module led The light goes on and off , And print relevant information in the serial port debugging assistant .
One 、 summary
1. brief introduction
This module is based on touch detection IC(TTP223B) Capacitive inching touch switch module . Normally , Module output low level , The mode is low power consumption mode ; When touching the corresponding position with your finger , The module outputs a high level , Switch mode to fast mode ; When continuous 12 Seconds without touch , The mode is switched to low power consumption mode . Modules can be mounted on non-metallic materials such as plastic 、 The surface of the glass , In addition, put a thin piece of paper ( Nonmetal ) Cover the module surface , As long as the position of the touch is correct , Can be made to hide in the wall 、 Buttons on the desktop, etc .
2. Product features
- Inching type : The initial state is low , Touch high , Low level without touch ( Similar to the touch button function )
- low power consumption
- The power supply can be 2-2.5V
- Both front and back sides can be used as touch surfaces , It can replace the traditional touch button
- Control interface : common 3 One pin (GND、VCC、SIG),GND For the land ,VCC Provide power supply ,SIG Output pin for data signal
- Power indicator : green LED, It lights up when the power is on correctly ;
- Touch area : Icon internal area similar to indication , Touch with your finger to trigger
Two 、 Experimental materials
- Minimum system STM32F10SC8T6
- Capacitive inching touch switch module
- There are several DuPont lines
3、 ... and 、 Hardware connection
| Module pin | GPIO |
|---|---|
| VCC | VCC |
| GND | GND |
| SIG | PA1 |
notes :1: touch
Four 、 Program code
1. initialization
void Switch_Touch_Pin_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1;
GPIO_Init(GPIOA,&GPIO_InitStruct);
}
2. State read
//1: touch
int Switch_Touch_Value(void)
{
return GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_1);
}
3. The main function
int main(void)
{
int flag = 0;
Switch_Touch_Pin_Init();
Usart1_Pin_Init(115200);
Sys_Delay_Init();
Led_Init();
printf(" Successful initialization \r\n");
while(1)
{
if(Switch_Touch_Value())
{
LED_TRUN;// The light status is reversed
flag++;
while(Switch_Touch_Value());// Waiting for release
if(flag == 1)
{
printf(" open led The lamp \r\n");
}
if(flag == 2)
{
flag = 0;
printf(" close led The lamp \r\n");
}
}
}
}
5、 ... and 、 Experimental results

Complete procedures and relevant data :
link :https://pan.baidu.com/s/15vrdCwts_bA5bA6gL-hKnQ
Extraction code :pib9
If there is any mistake, please point out , thank you !
边栏推荐
- ls 常用参数
- NFT双币质押流动性挖矿系统开发
- 西北工业大学遭黑客攻击?双因素认证改变局面!
- Landcover100, planned land cover website
- The script implements the automated deployment of raid0
- Introduction and tutorial of SAS planet software
- 实时渲染:实时、离线、云渲染、混合渲染的区别
- 60 divine vs Code plug-ins!!
- 【计算讲谈社】第三讲:如何提出关键问题?
- A detailed explanation of the implementation principle of go Distributed Link Tracking
猜你喜欢

应用实践 | 海量数据,秒级分析!Flink+Doris 构建实时数仓方案

Introduction and tutorial of SAS planet software

网络安全审查办公室对知网启动网络安全审查

A detailed explanation of the implementation principle of go Distributed Link Tracking

对国产数据库厂商提几个关于SQL引擎的小需求

Necessary fault handling system for enterprise network administrator

Volcano becomes spark default batch scheduler

多云模式并非“万能钥匙”

PHP OSS file reads and writes files, and workman generates temporary files and outputs them to the browser for download

Internet of things? Come and see Arduino on the cloud
随机推荐
Would you like to ask whether the same multiple tasks of the PgSQL CDC account will have an impact? I now have only one of the three tasks
小白请教下各位大佬,cdc抽取mysql binlog是严格顺序的吗
php OSS文件读取和写入文件,workerman生成临时文件并输出浏览器下载
【计算讲谈社】第三讲:如何提出关键问题?
假如,程序员面试的时候说真话
Application DDoS attack principle and defense method
This is not safe
Do you have all the basic embedded knowledge points that novices often ignore?
Northwestern Polytechnic University attacked by hackers? Two factor authentication changes the situation!
建立自己的网站(8)
《Go题库·11》channel的应用场景
R语言 4.1.0软件安装包和安装教程
想问下 pgsql cdc 账号同一个 多个 task 会有影响吗,我现在3个task 只有一个 有
论文解读(SR-GNN)《Shift-Robust GNNs: Overcoming the Limitations of Localized Graph Training Data》
NFT质押流动性挖矿系统开发技术
How to select the ECS type and what to consider?
对国产数据库厂商提几个关于SQL引擎的小需求
Several ways of connecting upper computer and MES
PHP OSS file reads and writes files, and workman generates temporary files and outputs them to the browser for download
请教一个问题。adbhi支持保留一个ID最新100条数据库,类似这样的操作吗