https://github.com/micropython/micropyt ... /sdcard.py
Looking at the code, there are comments to show you how to use it with pyboard and ESP8266-based boards. The code
also includes comments relating to Microbit, leading me to believe someone tried to put in Microbit support, but failed to
add the comments to document how to use it. Any assistance would be appreciated.
The SPI pins on the Microbit are 13, 14, 15 and (usually) 16 for Clock, MISO, MOSI and CS, respectively. If example for
ESP8266 is close to Microbit, we might try:
My first guess wasn't getting me anywhere.
Seems support is either preliminary, in flux or just not well documented.
Code: Select all
from microbit import * # May be needed for 'os', 'pin16' and 'spi' ?? import sdcard # Copy 'sdcard.py' to microbit's internal filesystem in flash memory beforehand. # Above 'import sdcard' command generates "MemoryError: memory allocation failed, allocating 1096 bytes" errors sd = sdcard.SDCard("", pin16) # Microbit has a flat filesystem. So use null string or "\" ?? And pin16 for SPI CS line. os.mount(sd, '/sd') # No 'mount' or 'unmount' functions in Microbits' 'os' module. os.listdir('/')