How mchobby/micropython-oled-menu works
OLED MENU is a non-blocking MicroPython menu for a 128×64 I²C OLED and rotary encoder. The main workflow is an application creating and updating the menu, responding to selected entries, and optionally handing control to range, combo, or application-drawn screen controls. The graph reflects the single sampled runtime module and the README; internal wiring not shown in the excerpts is left out.
Main entry points: oledmenu.py Menu runtime
Components 12
Menu runtime
- Menu runtime
lib/oledmenu.py - Menu entries
lib/oledmenu.py - Focus navigation
lib/oledmenu.py - Menu rendering
lib/oledmenu.py
Entry controls
- Range control
lib/oledmenu.py - Combo control
lib/oledmenu.py - Screen control
lib/oledmenu.py
Display and input
- SSD1306 driver
- 128×64 OLED
- I²C encoder driver
- Rotary encoder
Other components
- Main application
Connections 19
- Main application → Menu runtime: creates and updates
- Menu runtime → Main application: returns selection
- Menu runtime → Menu entries: adds entries
- Menu runtime → Focus navigation: updates focus
- Menu runtime → Menu rendering: draws menu
- Menu runtime → Range control: dispatches updates
- Menu runtime → Combo control: dispatches updates
- Menu runtime → Screen control: starts control
- Range control → SSD1306 driver: draws range
- Combo control → Menu entries: creates submenu entries
- Screen control → Main application: calls screen hooks
- Screen control → SSD1306 driver: clears display
- Menu rendering → SSD1306 driver: draws entries
- SSD1306 driver → 128×64 OLED: renders pixels
- Menu runtime → I²C encoder driver: reads encoder state
- Range control → I²C encoder driver: reads and resets
- Combo control → I²C encoder driver: resets encoder
- Screen control → I²C encoder driver: resets encoder
- I²C encoder driver → Rotary encoder: reads input