ESP 32-Using SDcard and Datalogging

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Posts: 1
Joined: Thu Jan 16, 2020 5:21 pm

ESP 32-Using SDcard and Datalogging

Post by Gabriel.Reis » Thu Jan 16, 2020 5:38 pm

Hello, i am starting in ESP 32 with micropython, and one of the parts of my projects is use a SD Card Reader for save some variables (like temperature and weight), but i am having some problems to put the SD Card Reader to work.

the first problem is this message : "AttributeError: 'module' object has no attribute 'SDCard'", i am using the from ... /, but i don't know how to solve this problem. And the second one is how can i put the SD card to save the variables that i said before?

The code i am using for test the SD card

Code: Select all

import machine, sdcard, os
from machine import Pin, SPI
spisd = SPI(-1, sck=Pin(14), mosi=Pin(15), miso=Pin(2))
sd = sdcard.SDCard(spisd, machine.Pin(13))
os.mount(sd, '/sd')

Posts: 303
Joined: Sun Apr 17, 2016 1:55 pm

Re: ESP 32-Using SDcard and Datalogging

Post by shaoziyang » Fri Jan 17, 2020 1:57 am

Please refer to the following instructions: ... DCard.html

Post Reply