![Handson Technology ESP8266 WiFi Manual Download Page 18](http://html1.mh-extra.com/html/handson-technology/esp8266-wifi/esp8266-wifi_manual_3556998018.webp)
Schematics
To upload code to your ESP8266, you should connect your ESP8266 to your PL2303HX USB-UART Programming Cable
like the figure below:
Writing Your Lua Script
Below is your script to blink an LED.
Right now you don’t need to worry how this code works, but how you can upload it to your ESP8266.
lighton=0
pin=4
gpio.mode(pin,gpio.OUTPUT)
tmr.alarm(1,2000,1,function()
if lighton==0 then
lighton=1
gpio.write(pin,gpio.HIGH)
else
lighton=0
gpio.write(pin,gpio.LOW)
end
end)
18