WiFiMCU Based on EMW3165 - User Manual

1 Flash LED -use TIMER module

A LED is flashed every 500ms in this example. The LED on WiFiMCU is used. Timer0 is set to toggle gpio17 in the Lua scripts.

STEP 1, Save the Lua scripts below as “Flash_LED.lua”.

1.print("---WiFiMCU Demo---")

2.print("Flash LED")

3.pin = 17

4.gpio.mode(pin,gpio.OUTPUT)

5.tmr.start(0,500,function()

6. gpio.toggle(pin)

7.end)

STEP2, Upload the scripts via WiFiMCU STUDIO, Run this script.

STEP 3, The LED on WiFiMCU board will be flashing every 500ms.