0

Using SD card with CircuitPython 0.8.2
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using SD card with CircuitPython 0.8.2

by JPJ on Sun Jan 15, 2017 7:19 pm

tannewt asked me to post the code I used to mount the SD card. It's shown below and straight out of Tony's MicroPython Hardware: SD cards tutorial here: https://learn.adafruit.com/micropython- ... ds/esp8266

I'm using the Adafruit Feather Huzzah ESP8266 with Adalogger Feather Wing holding the SD card. Firmware is CircuitPython 0.8.2.

I had to change line 122 of sdcard.py file because there is no time.sleep_ms() function available with in the current CircuitPython firmware. I used time.sleep() instead. I also converted sdcard.py to sdcard.mpy byte code using mpy-cross, placing the sdcard.mpy file in the ESP8266 '/' filesystem (not the sdcard filesystem).

Line 122 of sdcard.py, < before, > after change
Code: Select all | TOGGLE FULL SIZE
<             time.sleep_ms(50)
---
>             time.sleep(.05)

This code is in the bottom of my boot.py file:
Code: Select all | TOGGLE FULL SIZE
# SD card filesystem
import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1), machine.Pin(15))
os.umount()
vfs = os.VfsFat(sd, "")

JPJ
 
Posts: 14
Joined: Fri Jun 20, 2014 7:01 am

Please be positive and constructive with your questions and comments.