| .. | ||
| src | ||
| platformio.ini | ||
| README.md | ||
Exercise 05: SD Card Watcher
This exercise continuously watches SD card presence and prints state-change events.
Watcher behavior:
- Initializes PMU and enables SD power rail (AXP2101 BLDO1).
- Polls for card changes with debounced state transitions.
- Emits events only on change:
EVENT: card inserted/mountedEVENT: card removed/unavailableEVENT: no card detected
- On mount event, prints card info and runs SD write workflow.
- Every 15 seconds while mounted, runs a periodic write/permission check.
- Uses fast preferred probe (
HSPI @ 400k) and occasional full fallback scan.
Files used in this exercise:
/Exercise_05_test.txt/test/testsub1/testsubsub1/Exercise_05_test.txt
Build
source /home/jlpoole/rnsenv/bin/activate
pio run -e node_a
Upload
source /home/jlpoole/rnsenv/bin/activate
pio run -e node_a -t upload --upload-port /dev/ttyACM0
Monitor
screen /dev/ttyACM0 115200