Example: Turn On An Led - Digi XBee 3 Cellular LTE-M User Manual

Smart modem
Table of Contents

Advertisement

Deprecated kit (PN XK3-C-A2-UT-U or XK3-C-N1-UT-E)

Example: turn on an LED

Note
This example is only for kits that use the XBIB-U-DEV development board. For an example that
uses the XBIB-CU-TH development board, see
1. Note the DS4 LED on the XBIB board. The following image highlights it in a red box. The LED is
normally off.
2. At the MicroPython >>> prompt, type the commands below, pressing Enter after each one.
After entering the last line of code, the LED illuminates. Anything after a # symbol is a
comment, and you do not need to type it.
Note
You can easily copy and paste code from the
PDF version, as it may not maintain essential indentations.
import machine
from machine import Pin
led = Pin("D4", Pin.OUT, value=0)
# One might expect 0 to mean OFF and 1 to mean ON, and this is normally the
case.
# But the LED we are turning on and off is setup as what is# known as
"active low".
# This means setting the pin to 0 allows current to flow through the LED and
then through the pin, to ground.
3. To turn it off, type the following and press Enter:
Digi XBee® 3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
Example: Turn on an
LED.
online version of this
guide. Use caution with the
# Makes a pin object set to output 0.
Example: turn on an LED
330

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee 3 cellular nb-iot

Table of Contents