6. Next, navigate back to the MicroPython Terminal. No'ce that you can do this using the
submenu for the device:
7. At the MicroPython Terminal click the icon
8. We'll load and run from the REPL prompt first. At the >>> prompt, type import main to
start running your code.
9. The LED on the Development board should turn on and off every second.
10. Press Ctrl+C in the MicroPython Terminal window to stop the program from running.
Note that if you want to run it again in the terminal you will need to reset MicroPython
using Ctrl+D, so that the import main command can be loaded again. Otherwise the
command will not generate any response.
Running a program from the file system is easier than typing all the code line by line into the
REPL, but we want to run this program every time the XBee starts up, just the way we'd have to
with a device in the field. The Python Auto Start (PS) setting on the XBee controls whether
MicroPython code is launched at startup. To enable automatic code launching:
1. From the Device menu select SeDngs.
2. Click in the AT command to search... field at the top and type PS to highlight the Python
Auto Start seing.
3. Switch Python Auto Start to Enabled [1] and then click on the pencil icon
change to the XBee. Click Yes to con'nue if you get a warning message about the
MicroPython Terminal.
GSG v.1.1.2
to connect
to save that
20
Need help?
Do you have a question about the XBee Cellular and is the answer not in the manual?
Questions and answers