What it is
A joystick-steered asteroid digger running on an ESP32 and a 2.4" Nextion display. A little yellow digger drills through rock and collects blue and red gems, and clicking the stick makes a new asteroid. It's a pocket-sized cousin of Spacecavator, built to learn how far a bare display and a handful of parts can go.
A zoom knob (a B10K panel pot) zooms the view 1×, 2× or 4× around the digger. A startup check screen shows live readings with an OK beside each one, and waits for a click of the stick before it starts, so the joystick is calibrated at rest.
How it draws
The Nextion's own fonts garble when the display is turned sideways, so the ESP32 skips them entirely. Everything on screen is drawn as rectangles: letters from a 5 × 7 block font, the rock, the gems and the digger. Turning the picture 180° for the stand is just mirroring each rectangle. Once the display link runs at 921,600 baud, a new asteroid draws in about 100 ms.
What it taught me
- A joystick module is two potentiometers. Centred, mine read about 1880 of 4095, a bit under half, so the sketch measures the centre at power-up and ignores small tilts.
- Feed the joystick 3.3 V, whatever its "+5V" label says. ESP32 analog pins read only up to 3.3 V.
- Use ADC1 pins (GPIO 32–39) for analog inputs, since ADC2 stops working when Wi-Fi is on.
- An analog pin wired to nothing reads noise, and a pot whose ground lug drops out reads the top of the range. Both are ways of saying "not connected".
Known issue
The zoom knob's ground lug cuts out now and then, which snaps the zoom to fully out. It's a joint to re-solder.
The full build and the six faults it took to get here are in the notebook.




