🤖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

    PRODUCTS
    1
    2
    262
    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
      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
        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
        • First post
          Last post