【赚周年币】fireduino-测试TCH223触摸模块
#线上活动
2172 人阅读
|
0 人回复
|
2016-12-24
TA的每日心情 | 开心 2020-2-14 12:16 |
|---|
签到天数: 827 天 连续签到: 1 天 [LV.10]以坛为家III
状元
- 积分
- 7206
|
|
接上一篇帖子
【 】四周年庆-四周年庆-【赚周年币】fireduino-上电、升级模式-爱板网论坛 - 电子工程师学习交流园地 https://www.cirmall.com/bbs/thread-59195-1-1.html
之前在atmel社区获得了触摸模块,型号TCH223,该模块中文介绍
【 】【Arduino uno】-----触摸模块 - Arduino设计 - Atmel技术区
http://atmel.eefocus.com/module/forum/thread-11170-1-1.html
直接修改blink例程如下,下载测试- int led = 13;
- // the setup routine runs once when you press reset:
- void setup() {
- Serial.begin(115200);
- // initialize the digital pin as an output.
- pinMode(4,INPUT);
- pinMode(led, OUTPUT);
- }
- // the loop routine runs over and over again forever:
- void loop() {
- if(digitalRead(4)==HIGH)
- {
- digitalWrite(led, HIGH);
- delay(100);// turn the LED on (HIGH is the voltage level)
- Serial.println("thanks to EEboard and Firefly ");
- }
- else
- {// wait for a second
- digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
- } // wait for a second
- }
复制代码 编译下载,没有触摸时,LED反而亮了
触摸时LED灭,串口有输出
怎么回事?检查程序,没有问题,看硬件,哦,原来是LED上拉了,大家只要把LED程序调换一下位置即可实现触摸时输出字符
另外,发现个问题,程序下载的时候设备管理器串口会消失,类似返回升级模式以前,过一会又有了,怪怪的
还有开发板开发板5V旁边是3V,arduino不是3.3V吗?3V是何理由?期待工程师介绍一下
|
评分
-
查看全部评分
|
|
|
|
|
|
|
|