|
Post by 邱老师 on Jan 1, 2021 14:55:08 GMT
通过按钮来控制数字读取是高电平或是低电平,具体原理请看 这里接线方法:arduino D2口接到K1独立按钮 链接:https://pan.baidu.com/s/1iXUDy2FYldCLw0ZPC0vDQA 提取码:42nc 运行效果:查看串口打印窗口:系统从D2号口读取到高电平,然后在串口输出1;按下按钮以后,D2口与GND接通,系统从D2口读到低电平,在串口输出0
|
|
|
Post by 邱老师 on Jan 1, 2021 15:15:34 GMT
独立按钮的一脚接vcc,系统内置一个上拉电阻,当按下按钮以后,D2口被接地,因此这种触发模式叫低电平有效。
|
|
|
Post by 邱老师 on Jan 1, 2021 15:16:50 GMT
上述接法如果没有上拉电阻,按下按钮后,VCC与GND就直接相连,造成短路。
|
|
徐晨涛
New Member
Posts: 29
|
Post by 徐晨涛 on Jan 10, 2021 6:41:36 GMT
完成
|
|
叶子郑茂
New Member
Posts: 13
|
Post by 叶子郑茂 on Jan 10, 2021 6:50:24 GMT
完成!
|
|
胡志松
New Member
Posts: 26
|
Post by 胡志松 on Jan 10, 2021 8:27:17 GMT
完成
|
|
|
Post by 王骞 on Jan 17, 2021 6:47:57 GMT
完成
|
|
毛显棋
Junior Member
王骞是傻逼SBSBSBSBSBBSBSB
Posts: 80
|
Post by 毛显棋 on Jan 17, 2021 6:48:05 GMT
完成
|
|
|
Post by 王骞 on Jan 17, 2021 6:51:36 GMT
完成
|
|
卢占卡
New Member
听邱老师讲话是快速入眠的最好方式
Posts: 35
|
Post by 卢占卡 on Jan 17, 2021 8:14:22 GMT
完成
|
|