Get started with MicroPython
Use the MicroPython Terminal in XCTU
You can use the MicroPython Terminal to communicate with the XBee 3 Zigbee RF Module when it is in
MicroPython mode.
in
Use XCTU to enter the MicroPython
1. Click the Tools drop-down menu
opens.
2. Click Open to open the Serial Port Configuration window.
3. In the Select the Serial/USB port area, click the COM port that the device uses.
4. Verify that the baud rate and other settings are correct.
5. Click OK. The Open icon changes to Close
If the >>> prompt appears, you are connected properly. You can now type or paste MicroPython code
in the terminal.
MicroPython examples
This section provides examples of how to use some of the basic functionality of MicroPython with the
XBee 3 Zigbee RF Module.
Example: hello world
1. At the MicroPython >>> prompt, type the Python command: print("Hello, World!")
2. Press Enter to execute the command. The terminal echos back Hello, World!
Example: enter MicroPython paste mode
In the following examples it is helpful to know that MicroPython supports
copy a large block of code from this user guide and paste it instead of typing it character by character.
To use paste mode:
1. Copy the code you want to run. For example, copy the following code that is the code from the
"Hello world" example:
print("Hello World")
Note
You can easily copy and paste code from the
PDF version, as it may not maintain essential indentations.
2. In the terminal, at the MicroPython >>> prompt type Ctrl-+E to enter paste mode. The terminal
displays paste mode; Ctrl-C to cancel, Ctrl-D to finish.
3. Right-click in the MicroPython terminal window and click Paste or press Ctrl+Shift+V to paste.
4. The code appears in the terminal occupying one line. Each line starts with its line number and
three "=" symbols. For example, line 1 starts with 1===.
1
See
Other terminal programs
Digi XBee® 3 Zigbee® RF Module
1
This requires XCTU 6.3.10 or higher. To enter MicroPython mode, follow the steps
environment. To use the MicroPython Terminal:
if you do not use the MicroPython Terminal in XCTU.
Use the MicroPython Terminal in XCTU
and select MicroPython Terminal. The terminal window
, indicating that the device is properly connected.
online version of this
paste
mode, where you can
guide. Use caution with the
27
Need help?
Do you have a question about the XBee 3 ZigBee and is the answer not in the manual?