NodeMCU教程 板载自带LED测试

On the board of NodeMCU, there are two leds what can be tested.

1、First LED

Through the pcb file of  NodeMCU (see Figure-1 or  https://github.com/nodemcu/nodemcu-devkit-v1.0/blob/master/NODEMCU_DEVKIT_V1.0.PDF ), we can find the first led which connected by GPIO16 and VDD3V3. The index of pin is 0. (see another article of mine:《The Operation and Map of NodeMCU》). By executing the Code Block-1 can light it.

2、Second LED

By reading the circuit design schematic of ESP8266(Figure-2), we can see the led  connected by GPIO2 and VDD3 ,which's pin index is 4. Executing the Code Block-2 can light it.

—————————————————————————————————————————

上面是练英语写作的,欢迎吐槽吐舌头。中文如下:

在NodeMCU开发板上是有两个自带的LED灯供我们测试的。

1、第一个LED

通过NodeMCU的PCB电路图文件 (Figure-1 或者参考官方文档https://github.com/nodemcu/nodemcu-devkit-v1.0/blob/master/NODEMCU_DEVKIT_V1.0.PDF ),我们可以找到第一个LED,两端连接到3.3V电压和GPIO16。对照我的另一篇文章《NodeMCU GPIO操作与引脚映射》可以查到其引脚序号为0。

下图为NodeMCU部分电路原理图Figure-1:



执行下列代码即可点亮它。

Code Block-1:

[javascript] view plain copy
  1. gpio.mode(0,gpio.OUTPUT)  
  2. gpio.write(0, gpio.LOW)  

熄灭: gpio.write(0, gpio.HIGH)


2、第二个LED

查阅ESP8266的电路原理图可知,LED连接的是3.3V电压和GPIO2,对应引脚序号为4。

下图为ESP8266部分电路原理图Figure-2:



执行下列代码即可点亮它。
Code Block-2:
[javascript] view plain copy
  1. gpio.mode(4,gpio.OUTPUT)  
  2. gpio.write(4, gpio.LOW)  


熄灭: gpio.write(4, gpio.HIGH)

【转载请注明出处:http://blog.csdn.net/leytton/article/details/51650082

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值