Examples#
Annotated firmware examples showing real-world PyMCU patterns.
Unless otherwise noted, examples target ATmega328P / Arduino Uno and ship with a cycle-accurate integration test (AVR8Sharp simulator) so you can run them without hardware. Raspberry Pi Pico (RP2040) examples run on the alpha ARM backend and are validated with the RP2040Sharp emulator.
MicroPython compatibility layer#
Use these examples if you are porting code from MicroPython or writing new firmware that should remain runnable on a real MicroPython board.
Example |
Topics |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
CircuitPython compatibility layer#
Use these examples if you are porting Adafruit / CircuitPython code or writing firmware that should remain runnable on a real CircuitPython board.
Example |
Topics |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
PyMCU HAL (native)#
Direct use of the PyMCU hardware abstraction layer — maximum control, zero overhead.
Example |
Topics |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Advanced patterns#
Example |
Topics |
|---|---|
Timer, |
|
ADC, Timer ISR, GPIOR flags, UART |
|
|
|
|
Raspberry Pi Pico (RP2040) — alpha#
Firmware for the Raspberry Pi Pico via the alpha ARM backend (pip install pymcu-arm) — GPIO + UART0 on core 0.
All three API styles (native HAL, MicroPython, CircuitPython) are shown in
Raspberry Pi Pico (RP2040).