// the find
peterhinch/micropython-samples
Assorted code ideas, unofficial MP FAQ, plus index to my other repositories.
A long-running personal collection of MicroPython utilities, code snippets, and an index to the author's other (more complete) MicroPython projects. It's primarily useful as a reference dump for embedded Python developers working with ESP32, Pyboard, or RP2040 hardware — not a library you import, but a place you mine for ideas and working patterns.
The asyncio MQTT driver linked in section 5.5 is the real gem here — it handles WiFi outage recovery that the official driver ignores entirely. The rotary encoder docs are unusually thorough, covering the actual edge cases (missed pulses, debounce) rather than just the happy path. The serialisation comparison essay is a practical breakdown of five MicroPython serialisation options with actual tradeoffs, not just feature lists. The RP2 PIO/DMA samples in section 4.20 are rare — nonblocking SPI master/slave using PIO is hard to find documented anywhere.
This is a personal dumping ground, not a library — quality and completeness vary wildly across directories, and the author says upfront he may ignore feature requests and won't guarantee bug fixes. Several sections are Pyboard-specific and useless to anyone on ESP32 or RP2040. The repo structure makes it awkward to use as a dependency: you're copying files manually, not installing a package. Some content like the PicoWeb directory is vestigial — it references a dead fork that no longer works with current MicroPython.