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 gpio.mode(0,gpio.OUTPUT) 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 gpio.mode(4,gpio.OUTPUT) gpio.write(4, gpio.LOW)
熄滅: gpio.write(4, gpio.HIGH)
【轉載請註明出處:http://blog.csdn.net/leytton/article/details/51650082】