Adafruit_sdcard

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
slemieux99
 
Posts: 4
Joined: Fri Feb 09, 2024 1:24 pm

Adafruit_sdcard

Post by slemieux99 »

Hi All.

The Device i have
UF2 Bootloader v2.0
Model: Raspberry Pi RP2
Board-ID: RPI-RP2
Adafruit CircuitPython 8.2.9 Raspberry Pi Pico with rp2040

i am trying to read/write to MicroSD, every time i run the script i get the same error.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'sdcard'

not sure whats up, would appreciate any help to resolve this,
Attachments
ckypi.PNG
ckypi.PNG (608.42 KiB) Viewed 76 times

User avatar
dastels
 
Posts: 15492
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit_sdcard

Post by dastels »

You need to copy the sdcard library to CIRCUITPY/lib, i.e. adafruit_sdcard.mpy

Dave

User avatar
danhalbert
 
Posts: 4561
Joined: Tue Aug 08, 2017 12:37 pm

Re: Adafruit_sdcard

Post by danhalbert »

You could use the builtin module `sdcardio` instead, as well.

User avatar
slemieux99
 
Posts: 4
Joined: Fri Feb 09, 2024 1:24 pm

Re: Adafruit_sdcard

Post by slemieux99 »

dastels wrote: Fri Feb 09, 2024 1:40 pm You need to copy the sdcard library to CIRCUITPY/lib, i.e. adafruit_sdcard.mpy

Dave

Hi i did copy the library to the lib folder on the CIRCUITPY Drive, in the Lib folder, the file is in the root lib folder,
but still get the same error

User avatar
slemieux99
 
Posts: 4
Joined: Fri Feb 09, 2024 1:24 pm

Re: Adafruit_sdcard

Post by slemieux99 »

danhalbert wrote: Fri Feb 09, 2024 2:15 pm You could use the builtin module `sdcardio` instead, as well.
would you have an example of this, and what is needed to use it.

User avatar
dastels
 
Posts: 15492
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit_sdcard

Post by dastels »


User avatar
slemieux99
 
Posts: 4
Joined: Fri Feb 09, 2024 1:24 pm

Re: Adafruit_sdcard

Post by slemieux99 »

dastels wrote: Fri Feb 09, 2024 1:40 pm You need to copy the sdcard library to CIRCUITPY/lib, i.e. adafruit_sdcard.mpy

Dave
yes i do please

User avatar
dastels
 
Posts: 15492
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit_sdcard

Post by dastels »

I encourage you to use sdcardio.

In either case, see https://learn.adafruit.com/adafruit-mic ... cuitpython for details and example code.

Dave

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”