Pyboard Basics

There seems to be a new and different micro controller development board being released every week at the moment. There also seems to be a trend towards supporting different languages. I just got myself a Pyboard to play with. The clue is in the name with this one: it come preloaded with a restricted version of Python called MicroPython. IT took me a while to get set up with using this on Ubuntu so I thought I'd give a brief description here. First we are going to need a need a command line tool called minicom which can be installed with:

sudo apt-get install minicom
Plug your Pyboard into the USB port and run minicom with this command:
minicom -D /dev/ttyACM0

Now hit ctrl-a, this will instruct minicom to accept commands, followed by ctrl-c which will send a keyboard interrupt tot the pyboard and you should now see an interactive command prompt or REPL (read, evaluate, print loop). Navigate to the PYBFLASH folder, open the main.py file with your favourite editor, edit it and save it. Now return to the command prompt with minicom running and hit ctrl-d this will perfom a soft restart of the pyboard. When it restarts it will run the main.py file. You should either see the output of your code at the command prompt or more likely a runtime error. Correct it, hit ctrl-d and repeat. If anything goes seriously wrong you will need to do a hard reset of the Pyboard by pressing the reset button on the board itself. Before doing this however, make sure you quit minicom by hitting ctrl-a, followed by x (without the ctrl). I have found failing to do this can cause Ubuntu to crash.

Comments