第1节、Micro Bit 入门示例-外边按钮连接运用
<h1 style="color: black; text-align: left; margin-bottom: 10px;">序言</h1><span style="color: black;">本示例是在学习<span style="color: black;">运用</span> Micro Bit 中的<span style="color: black;">有些</span>实战记录,是一个近乎从0 <span style="color: black;">起始</span>的学习过程记录,偏重于动手实践,理论部分<span style="color: black;">因为</span>个人<span style="color: black;">针对</span>硬件知识比较匮乏,欢迎有<span style="color: black;">关联</span>专业人员进行<span style="color: black;">弥补</span></span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">实验目的</h1><span style="color: black;">在Mirro Bit 上<span style="color: black;">运用</span><span style="color: black;">外边</span>按钮</span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">前置<span style="color: black;">要求</span></h1><span style="color: black;">Mircro 主板</span><span style="color: black;">IoBit 扩展板</span><span style="color: black;">按钮</span><span style="color: black;">杜邦线</span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">线路连接</h1><span style="color: black;">按钮图示</span>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/8c61bc14612b416797cf2a03e2925f68~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728787583&x-signature=me0l55PV5WR76ku%2FU3%2BkpB3UH6c%3D" style="width: 50%; margin-bottom: 20px;"></div><span style="color: black;">连线图示</span><span style="color: black;">按钮 GND引脚 连接 Iobit 扩展板 GND引脚(黑色)</span><span style="color: black;">按钮 OUT引脚 连接 Iobit 扩展板 IO 引脚0(黄色)</span><span style="color: black;">按钮 UCC 引脚 连接 Iobit 扩展板 3V电压 引脚(红色)</span>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/00296559808849878b67644d66659f54~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728787583&x-signature=2I4u8RmOMUitJp2GzAAkq8Yc0ro%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">程序</h1><span style="color: black;">javascript</span> <span style="color: black;">let</span> redButton = <span style="color: black;">0</span>
basic.forever(<span style="color: black;"><span style="color: black;">function</span> () </span>{
redButton = pins.digitalReadPin(DigitalPin.P0)
basic.showNumber(redButton)
})<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/5df942ba7c6f4d9ebb0d7eef1059d919~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728787583&x-signature=8hx3jxdoloqTKNKQidBBKd8O5T0%3D" style="width: 50%; margin-bottom: 20px;"></div>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">验证</h1><span style="color: black;">按下按钮时,<span style="color: black;">表示</span>数字 1</span><span style="color: black;">释放按钮时,<span style="color: black;">表示</span>数字 0</span>
谷歌网站排名优化 http://www.fok120.com/ 我赞同你的看法,你的智慧让人佩服,谢谢分享。
页:
[1]