NodeMCU教程 板載內建LED測試

來源:互聯網
上載者:User
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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.