🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5Stack Core S3 Access to SDCARD Micropython

    Scheduled Pinned Locked Moved PRODUCTS
    2 Posts 1 Posters 1.5k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      LordInchcape
      last edited by

      Hello,
      Can someone point me at some example code to access the SDCard in Core S3 using micropython?
      Last year there were several discussion topics, I suspect it works. Just need a sample.
      Thanks

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        LordInchcape @LordInchcape
        last edited by

        @LordInchcape Using M5CoreS3_SDCard_read_dir_UIFlow2.0.4 the following micropython will work:-
        *import machine
        import os

        card = machine.SDCard(slot=2, sck=36, miso=35, mosi=37, cs=4, freq=1000000)
        os.mount(card,"/sd")
        print(os.listdir("/sd"))

        f = open("/sd/test.txt", "w")
        f.write("Hello world\r\n")
        f.close()

        g = open("/sd/test.txt", "r")
        print(g.read())
        g.close()
        os.unlink("/sd/test.txt")**

        Still to determine if it treads on something else.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post