EasyManuals Logo

Digi IX20 User Manual

Digi IX20
1188 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #830 background imageLoading...
Page #830 background image
Applications Theuse(led) function
IX20 User Guide
830
Available LED states
State Attribute name
Solid on State.ON
Off State.OFF
Flash State.FLASH
Use Python to set the state of LEDs
The following example usesan interactivePython 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 (main, Mar 30 2023, 23:47:13) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
2. Import the led submodule:
>>> from digidevice import led
3. Import the Led and State objects from the led submodule:
>>> from digidevice.led import Led, State
4. Use led.acquire() to gain control of the all LEDs:
>>> led.acquire(Led.ALL)
5. Use led.set() to set the state of the LEDs:
>>> led.set(Led.ALL, State.FLASH)
6. (Optional) Use led.release() to release the LEDs to system control:
>>> led.release(Led.ALL)
7. Use Ctrl-Dto exit the Python session. You can also exit the session using exit() or quit().
The use(led) function
The use(led) function can be used to acquire control of LEDs and then release them back to system
control.
To create a function that acquires control of the power LED, sets it to a state of fast flashing, and then
releases control when the function has completed, use the following code in a python application:
with use(Led.POWER) as pwr:
pwr(State.FLASH)

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Digi IX20 and is the answer not in the manual?

Digi IX20 Specifications

General IconGeneral
CategoryWireless Router
Cellular Connectivity4G LTE
Ethernet Ports4
Wi-Fi802.11ac
SIM Slots2
WAN Ports1
LAN Ports3
Weight0.5 kg
Operating Temperature-40°C to +70°C (-40°F to +158°F)