LED
This command was created to avoid having to mess with GPIO pins and TIMER commands. Its secondary purpose is to easily demonstrate the output of more complex commands. In the first row of the Setup/Peripherals menu, the LED wiring can be configured. The built-in LED of the WeMos D1 mini module is D4-Vcc, which is the default setting. If WiFi is checked (default), it blinks quickly in AccessPoint mode when someone is connected. In client mode, it blinks slowly if it successfully connects to the router. It flashes during boot. It lights up while formatting the storage, and you have to wait until it goes out. The GPIO command issued to the LED pin stops the WiFi status indication.
LED@
Sends the LED status to STDOUT. The @ can be used after every LED command.
LED(ON)
The LED is on.
LED(OFF)
The LED is off.
LED(TOGGLE)@
The LED toggles its state.
LED(EMBER)
The LED glows.
LED(FLASH)
The LED lights up for 250ms.
LED(FLASHI)
The LED state changes for 250ms.
LED(3000)
The LED lights up for 3000ms.
LED(BLINK1)
The LED blinks.
LED(BLINK2)
The LED blinks slowly.
LED(BLINK3)
The LED blinks quickly.
LED(BLINK4)
The LED blinks slowly, inverse.
LED(BLINK5)
The LED blinks quickly, inverse.
LED(BLINK6)
The LED blinks very quickly.
LED(WIFI)
The LED shows the WiFi status.
Examples
WebSocket example, the "button" element toggles the LED. The WebSocket connection is created in the script.
LED CONTROL
TOGGLE
When opening the webpage, the LED turns on, and when closing it, the LED shows the WiFi connection status. The WebSocket connection is handled by tools.js
Open Page: The LED is on.
Close Page: The LED shows the WiFi state.