Ameba MicroPython: [RTL8722DM mini] SDFS Data Editing

Materials

  • Ameba RTL8722DM_MINI x 1
  • MicroSD Card x 1 (SD card must be < 32GB with format set to fatfs)

Steps

SD File System module supports SD card data manipulation in the form of file. With it, you can control and inspect files as you like and keep them on non-volatile memory.

Copy and paste the following code line by line into REPL to see its effect.

from machine import SDFS

s=SDFS()                # create a short form
s.create("ameba.txt")   # create a file named "ameba.txt"
s.write("ameba.txt", "ameba supports sd card file system!") # write a string to the file just created
s.read("ameba.txt")     # read the content from the same file
s.rm("ameba.txt")       # delete the file

Note: No file open or close is needed, the API does that automatically for you.

Copyrights ©瑞晟微电子(苏州)有限公司 2021. All rights reserved.
Please confirm that QQ communication software is installed