RTC keeps time between POWER OFF & ON, SD Card at start still needs work -- if card is in the slot, it is not readable until it is pulled on and then inserted.

This commit is contained in:
John Poole 2026-02-13 18:52:17 -08:00
commit 544d459c9b
11 changed files with 1288 additions and 6 deletions

View file

@ -0,0 +1,37 @@
## Exercise 04: SD Card
This exercise loops forever. Each cycle:
1. Prints `Sleeping 10 seconds` and waits 10 seconds.
2. Detects and mounts the SD card.
3. Prints card and filesystem info (type/size/used).
4. Writes `/Exercise_04_test.txt` with:
- `This is a test`
5. Ensures nested directories exist:
- `/test/testsub1/testsubsub1`
6. Writes nested file:
- `/test/testsub1/testsubsub1/Exercise_04_test.txt`
7. If either target file already exists, prints warning, erases it, then recreates it.
8. Demonstrates permission behavior:
- Notes FAT does not provide Unix `chmod/chown`.
- Shows access behavior via `FILE_READ` vs `FILE_WRITE` modes.
## Build
```bash
source /home/jlpoole/rnsenv/bin/activate
pio run -e node_a
```
## Upload
```bash
source /home/jlpoole/rnsenv/bin/activate
pio run -e node_a -t upload --upload-port /dev/ttyACM0
```
## Monitor
```bash
screen /dev/ttyACM0 115200
```