diff --git a/micropython/board/PICO_W_INKY/manifest.py b/micropython/board/PICO_W_INKY/manifest.py index 17514700..77511bf9 100644 --- a/micropython/board/PICO_W_INKY/manifest.py +++ b/micropython/board/PICO_W_INKY/manifest.py @@ -5,6 +5,9 @@ require("bundle-networking") require("urllib.urequest") require("umqtt.simple") +# SD Card +require("sdcard") + # Bluetooth require("aioble") diff --git a/micropython/examples/common/lib/sdcard.mpy b/micropython/examples/common/lib/sdcard.mpy deleted file mode 100644 index 7f3fd6bd..00000000 Binary files a/micropython/examples/common/lib/sdcard.mpy and /dev/null differ diff --git a/micropython/examples/inky_frame/README.md b/micropython/examples/inky_frame/README.md index 1420d0e1..7f4c5bea 100644 --- a/micropython/examples/inky_frame/README.md +++ b/micropython/examples/inky_frame/README.md @@ -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) diff --git a/micropython/examples/inky_frame/image_gallery/README.md b/micropython/examples/inky_frame/image_gallery/README.md index b31b62d9..4974775d 100644 --- a/micropython/examples/inky_frame/image_gallery/README.md +++ b/micropython/examples/inky_frame/image_gallery/README.md @@ -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