Inky Frame: Include SDCard from micropython-lib.

This commit is contained in:
Phil Howard 2023-10-06 13:52:11 +01:00
parent e691628723
commit 0f75a2839f
4 changed files with 13 additions and 7 deletions

View File

@ -5,6 +5,9 @@ require("bundle-networking")
require("urllib.urequest")
require("umqtt.simple")
# SD Card
require("sdcard")
# Bluetooth
require("aioble")

View File

@ -27,10 +27,6 @@ The wireless examples need `network_manager.py` and `WIFI_CONFIG.py` from the `c
You'll also need to install the `micropython-urllib.urequest` library using Thonny's 'Tools' > 'Manage Packages' or `common/lib/urllib` which contains a compiled `.mpy` version that uses less RAM. You should place this directory in `lib` on your Pico W.
Finally for examples loading images, you'll need `sdcard.mpy` from `common/lib`. You should place this file in `lib` on your Pico W.
- [/micropython/examples/common](../common)
### Button Test
[button_test.py](button_test.py)

View File

@ -24,11 +24,18 @@ Copy the images to your Pico W using Thonny.
### image_gallery_sd.py / image_gallery_sd_random.py
Pop an SD card into your computer to copy the images across. (Alternatively, you can transfer them using Thonny, but you will have to mount the SD card using the REPL first).
Pop an SD card into your computer to copy the images across.
The SD card examples require `sdcard.mpy` from `common/lib` - copy this file into the `lib` directory on your Pico W.
Alternatively, you can transfer them using Thonny, but you will have to mount the SD card using the REPL first:
- [/micropython/examples/common](../../common)
```python
import os
import sdcard
from machine import Pin
sd_spi = SPI(0, sck=Pin(18, Pin.OUT), mosi=Pin(19, Pin.OUT), miso=Pin(16, Pin.OUT))
sd = sdcard.SDCard(sd_spi, Pin(22))
os.mount(sd, "/sd")
```
## Image Credits