Your First F1 Code

F1 smart module pre-installed MicroPython as operating system (OS), which equips with REPL. REPL stands for Read-Eval-Print Loop which is an Interactive Interpreter Mode that allows you to input code, execute it, and immediately see the results.

Using the CtrlR Plugin, open and connect a device or use serial terminal (PuTTY, screen, picocom, etc). Upon connecting, there should be a blank screen with a flashing cursor. Press Enter and a MicroPython prompt should appear, i.e. >>>. Let’s make sure it is working with the obligatory test:

print("Hello F1!")
Hello F1!

In the example above, the >>> characters should not be typed. They are there to indicate that the text should be placed after the prompt. Once the text has been entered print("Hello F1!") and pressed Enter, the output should appear on screen, identical to the example above.

     
Basic Python commands can be tested out in a similar fashion.

If this is not working, try either a hard reset or a soft reset; see below.

Resetting the Device

If something goes wrong, the device can be reset with two methods: hard reset and soft reboot

Hard reset

By pressing the RESET button on F1 starter kit (or applying a high signal to F1 module reset signal), a reset signal is triggered to the RESET pin of F1 module. F1 module will reset itself.

Please notice that any serial/COM port connection will reset and may need to manually reconnect if auto-connect option is not enabled in CtrlR plug-in.

After reset, normal Micropython boot message will appear in the terminal of CtrlR plug-in or other serial terminals that have been connected as shown below:

Soft reboot

By pressing CTRL-D at the MicroPython prompt, which will perform a soft reset. A soft reboot message will appear in the terminal of CtrlR plug-in or other serial terminals that have been connected as shown below: