Applications
Develop Python applications
LR54 User Guide
744
n
Gain control of the LED with the led.acquire() function.
n
Define the state of the LED with the led.set() function.
n
Use the use() function to create a function that acquires, sets, and releases an LED.
n
Optionally release control of the LED with the led.release() function.
See
for instructions on using these methods.
Available LEDs
LED
Attribute name
Color
All available LEDs
Led.ALL
Power
Led.POWER
Blue
GNSS
Led.GNSS
Green
WIFI1 (LR54W only)
Led.WIFI1
Green
WIFI2 LR54W only)
Led.WIFI2
Green
WWAN1 Signal
Led.WWAN1_SIGNAL_GREEN
Green
Led.WWAN1_SIGNAL_YELLOW
Yellow
WWAN1 Service
Led.WWAN1_SERVICE_GREEN
Green
Led.WWAN1_SERVICE_YELLOW
Yellow
Available LED states
State
Attribute name
Solid on
State.ON
Off
State.OFF
Slow flash
State.FLASH_SLOW
Fast flash
State.FLASH_FAST
Use Python to set the state of LEDs
The following example uses an interactive Python session to set the state of all LEDs to flashing:
1. At the shell prompt, use the
python
command with no parameters to enter an interactive
Python session:
# python
Python 3.10.1 (default, May
9 2021, 22:49:59)
[GCC 8.3.0] on linux