EasyManuals Logo

Digi XBee3 XB3M1 User Manual

Digi XBee3 XB3M1
252 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 #67 background imageLoading...
Page #67 background image
Get started with MicroPython Example: debug the secondary UART
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
67
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 online version of this guide. Use caution with the
PDF version, as it may not maintain essential indentations.
import machine
from machine import Pin
led = Pin("D4", Pin.OUT, value=0) # Makes a pin object set to output 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:
led.value(1)
You have successfully controlled an LED on the board using basic I/O.
Example: debug the secondary UART
This sample code is handy for debugging the secondary UART. It simply relays data between the
primary and secondary UARTs.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Digi XBee3 XB3M1 Specifications

General IconGeneral
BrandDigi
ModelXBee3 XB3M1
CategoryModem
LanguageEnglish

Related product manuals