Brussels / 4 & 5 February 2023

schedule

Realtime 3D Graphics on a MicroPython ESP32

Hacking the EMFCamp Conference Badge


This is not really a "how-to" -- it's more of a "what-did"

I spent an unreasonable amount of time writing a software 3D renderer for an extremely small and low-power ESP32 device running MicroPython. I will talk about the problems I encountered, the optimisations I made, and the eventual contributions I was able to make back to the MicroPython project.

If you've been to other hacker conferences like EMFCamp or MCH, you may be familiar with the tradition giving attendees interesting hardware on a lanyard instead of a traditional conference badge. Attendees are encouraged to experiment with and hack on the device both at the conference and afterwards.

This year at EMFCamp 2022, the conference badge was a USB thumb drive sized ESP32 device running MicroPython. It has a joystick, an accelerometer, the cutest little LiPo battery, and a lovely 135x240 pixel colour TFT display. It seemed like it would be a fun single-weekend exercise to write a little 3D renderer for it in Python.

It turned out to be a "fun" multi-weekend exercise, but I learned a lot that I'd like to share. I learned how to workaround problems in the tooling. I learned there were problems in the display driver. I learned about optimising Python. I learned how to write native MicroPython modules to rewrite some hot functions in C. I learned about optimising how the Python talks to the C. And I even learned how to contribute some improvements back to the MicroPython project.

I will bring the device with me, catch me after the talk to see it rendering Utah teapots up close.

Speakers

Photo of Mat Booth Mat Booth

Links