From 0f75a2839f5c864f056905892924d66840d74157 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 6 Oct 2023 13:52:11 +0100 Subject: [PATCH] Inky Frame: Include SDCard from micropython-lib. --- micropython/board/PICO_W_INKY/manifest.py | 3 +++ micropython/examples/common/lib/sdcard.mpy | Bin 2554 -> 0 bytes micropython/examples/inky_frame/README.md | 4 ---- .../examples/inky_frame/image_gallery/README.md | 13 ++++++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 micropython/examples/common/lib/sdcard.mpy 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 7f3fd6bdc0739e00e3a9d1236cc480f353ccdb19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2554 zcma)6T~Hg>6}}QkU>W0Or7YMY&Uz)SWC?^=3EAmO$!hIj5+@cQ6lEqu#cB}(Nvlc% z$8A#X3V{jZPG~yqq)&b5Q{VK1O#PM^>^ObuOs3;u#?wAIGkst%F4JkA+Iv@$4f*Nx z0delR-~G;azI*mw(}P!DHPE7*O3CSgTuh8+WA4mNa9Zh7;_dlFN&+3@LI7ofMW4$g zK&zMo9bzgry)Xla*g`6GQ;qWSyp+Zf+ssX+q?DY!xtNe{05XwInU#_fmSf1xCo+Sej%@5260(?2f`R^_f>F_!jx_vQR3FX8QQ@oz3^R#z zGzs+B9VKk27a>)Osq{h$DCSl<1N55z039RB3&~j8o~L6{UdpBtX{p&Oy(ndK2{{dP zJ;;Epl*`EJoJ7xL_bj^qkActn;Y$}?k({i59Eo3rsHZR4{X)%iV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TOIp?)Ir3lE(`mnZC3<|gbc!}1>1?jd~@p9X)9+g0I>=HlPzX|PyMAfKz~ zL77LR|EqGz`0^nntk?Yo{Ec2~s3r$i5DGmV*cSe85J5lrpHR3%_M?jT`FHVqv$=^% zKSOthPUG;&PF4AOyBe?{p4;fzTOw>@sGxAAUMDE7d*&T1>SW`zr~k5NCgr)pu#A_r zlNX!XeOixpd#5S{HjgzSBF0ba%G5`u!B{d;XyhtrRQNBk_}_gO0`IGeAMo#~;1BN9 zYE9AF2o9gzuZyNjrt^&QA!-FZLGN2gyX%r?gSA<0<>Ia&l#IP%8NJ8?Iw1zd{{r$X BBtifH 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