Data Sheet
33
Hardware Connection
Open the LuaLoader, click the “Upload File…”cho ose ESP826 6 No deMCU kit demo code
-> P16_Servo_Remote_Control -> init.lua. After the upload completed then click “Download ” to
download the init.lua file.
Forward rotation:
for i=1,100,1 do
tmr.alarm(0,20,1,function () -- 50Hz
gpio.write(1, gpio.HIGH)
tmr.delay(2000) --Forward
gpio.write(1, gpio.LOW)
end)
end
Reversion
for i=1,100,1 do
tmr.alarm(0,20,0,function () -- 50Hz
gpio.write(1, gpio.HIGH)
tmr.delay(500) --Reversion
gpio.write(1, gpio.LOW)
end)
end
After the su cce ssfu l up lo ading , you will see the 9G ser vo auto rotat e in two
different dir ection .
Lesson17: TWO NodeMCU Communication
The ESP8266 NodeMCU has three kinds of working mode which are “AP” 、“STA”、“AP+STA”.
In this lesson we will use two NodeMCU to conmmunicate with each other. One NodeMCU to be
set as “AP” mode and another to be set as “STA” mode, then establish TCP service between them.
Material:
Crowtail- ESP8266 NodeMCU x 2
Hardware Connection