A picture of me.

Tom Hodson

Maker, Baker Programmer Reformed Physicist RSE@ECMWF


MicroPython Simulator

This simulator lets me quickly try out micropython code drawing to a 240x240 pixel color lcd display.

This particular display uses 5, 6 and 5 bits for each channel, respectively. The raw pixel data gets passed from micropython to javascript where it gets converted to normal RGB before being blitted to the <canvas> tag. Under the hood it uses the fact that the micropython VM supports being compiled to WASM.

I’m using a ttf font called gunship converted to bitmap format and frozen into the firmware along with other library code.

Building the code looks like:

1cd /ports/webassembly
2make min FROZEN_MANIFEST=/path/to/custom/manifest.py
3cp ...wasm and ....min.mjs to your webserver directory