Saturday, March 19, 2016

Test NodeMCU onboard LED in Lua shell

Once flashed update firmware to NodeMCU, we can test the onboard LED in Lua shell.


- Connect NodeMCU and run PuTTY to enter its Lua shell.
- Enter this code (in red) to test the onboard LED:

NodeMCU 0.9.6 build 20150704  powered by Lua 5.1.4
lua: cannot open init.lua
> gpio.mode(0, gpio.OUTPUT)
> gpio.write(0, gpio.HIGH)
> print(gpio.read(0))
1
> gpio.write(0, gpio.LOW)
> print(gpio.read(0))
0
>



This video show how to:


No comments:

Post a Comment