Skip to content

Instantly share code, notes, and snippets.

@gallaugher
Created March 3, 2023 00:37
Show Gist options
  • Save gallaugher/32a5eafa3fa5da280413e1d7dd3c6b28 to your computer and use it in GitHub Desktop.
Save gallaugher/32a5eafa3fa5da280413e1d7dd3c6b28 to your computer and use it in GitHub Desktop.
mount_sd.py
# mount_sd.py
import board, busio, sdcardio, storage
# setup pins for SPI
sck = board.GP10 # yellow
si = board.GP11 # blue
so = board.GP12 # green
cs = board.GP13 # yellow
spi = busio.SPI(sck, si, so)
sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment