Pages

Thursday, 3 July 2014

The Raspberry Pi meets MicroPython

One of the high spots of the Open Technology Workshop session at Cambridge was the chance to see and buy a MicroPython board (pyboard).

I've shown it to a few people, and it's always enchanted them, but today I introduced it to its big brother, the Raspberry Pi.

Connecting the Pi and the pyboard

I connected them using one of Pimoroni's excellent SparkFun Cerberus USB Hub Cables.

Py and piboard
As soon as I powered up the pyboard its filesystem appeared on the Pi desktop. Next I  used screen to open a serial session running Python on the MicroPython board.

The pyboard has an on-board filesystem, and can also use a micr0SD card, so you're not restricted to command-line programming. Python programs can access four LEDs, a button, the file system, some GPIO pins, the serial port, an I2C bus and SPI.

Interactive Python on the pyboard

In the screenshot below, I'm driving an interactive Python session on the pyboard from a screen window on the PI.


Raspberry Pi screen session running Python on the pyboard

My next step will be to use PySerial on the Pi so that a Python script running there can control the pyboard.