1 KiB
1 KiB
Exercise 14: Power (Charging + Visual)
This exercise is intentionally narrow in scope:
- Detect if a battery is present.
- Detect if USB/VBUS power is present.
- Determine if charging is needed.
- Keep charging enabled through AXP2101 PMU settings.
- Flash the PMU charge LED while charging.
- If fully charged, leave LED off (do nothing).
OLED behavior:
- For the first 2 minutes after boot, OLED shows:
Exercise 14 Power- node name (
NODE_LABEL) - time (RTC/system time if available, else uptime)
- charging state and battery stats
- After 2 minutes, it switches to a steady
Power Monitorheader while continuing live stats.
Meshtastic references used
src/Power.cpp- charging detection path (
isCharging(),isVbusIn(), battery checks)
- charging detection path (
src/modules/StatusLEDModule.cpp- PMU charging LED control via
PMU->setChargingLedMode(...)
- PMU charging LED control via
Build and upload
cd /usr/local/src/microreticulum/microReticulumTbeam/exercises/14_Power
pio run -e ed -t upload
pio device monitor -b 115200