Use The Micropython Terminal In Xctu; Micropython Examples; Example: Hello World; Example: Enter Micropython Paste Mode - Digi XBee3 DigiMesh 2.4 User Manual

Rf module
Hide thumbs Also See for XBee3 DigiMesh 2.4:
Table of Contents

Advertisement

Get started with MicroPython

Use the MicroPython Terminal in XCTU

You can use the MicroPython Terminal to communicate with the XBee3 DigiMesh RF Module when it is
in MicroPython mode.
steps 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
XBee3 DigiMesh 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 XBee3® DigiMesh 2.4 RF Module User Guide
1
This requires XCTU 6.3.10 or higher. To enter MicroPython mode, follow the
environment. To use the MicroPython Terminal:
and select MicroPython Terminal. The terminal window
if you do not use the MicroPython Terminal in XCTU.
Use the MicroPython Terminal in XCTU
, indicating that the device is properly connected.
paste
online version of this
guide. Use caution with the
mode, where you can
36

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the XBee3 DigiMesh 2.4 and is the answer not in the manual?

Table of Contents