Flashing MicroPython
BeeHive is driven mostly with MicroPython — a Python 3 implementation for microcontrollers. This page gets it running on your mainboard's ESP32.
Get your ESP32 ready
You'll need two things:
- Thonny IDE — a beginner-friendly Python editor that can flash and talk to the board. Installation is straightforward.
- The latest ESP32 MicroPython firmware — download the
.binfrom the ESP32 firmware page.
Flash the firmware
- Connect the ESP32 to your computer via USB.
- In Thonny, go to Tools > Options > Interpreter.
- Set the interpreter to MicroPython (ESP32).
- For the port, choose the one labelled Silicon Labs (the USB-serial chip).
- Click Install or update the firmware.
- Select the
.binfile you downloaded and flash it.
A detailed walkthrough is on Random Nerd Tutorials.
First program
With the firmware installed, Thonny's shell talks to the board live. A quick blink to confirm everything works:
from machine import Pin
import time
led = Pin(2, Pin.OUT) # onboard LED on many ESP32 dev boards
while True:
led.value(not led.value())
time.sleep(0.5)
Learn the basics
New to programming or microcontrollers? Work through the Intro to Electronics course — it covers the fundamentals and comes with the code from BeeHive's 2022 workshop exercises.
Prefer C++?
The ESP32 also runs Arduino/C++, which is handy when you need an existing library — the mouse maze recipe does this to reuse the Adafruit servo driver. Most recipes here use MicroPython.