Arduino UNO 测试SD卡

发布时间 2023-11-09 09:43:41作者: 无垠的广袤

SD卡模块测试方法

  1. Arduino IDE 的 Library Manager 中搜索 ‘SD’,安装最新版资料库;
  2. 依次打开 File - Examples - SD - CardInfo 示例程序,Upload 至开发板;
  3. 打开串口监视器 Serial Monitor,即可看到串口信息输出,如下
Card type:         SD2
Clusters:          15352
Blocks x Cluster:  32
Total Blocks:      491264

Volume type is:    FAT16
Volume size (Kb):  245632
Volume size (Mb):  239
Volume size (Gb):  0.23

Files found on the card (name, date and size in bytes): 
SYSTEM~1/     2023-11-08 14:22:34
  WPSETT~1.DAT  2023-11-08 14:22:34 12
  INDEXE~1      2023-11-08 14:22:36 76

常见报错及解决办法
Could not find FAT16/FAT32 partition.
办法:
使用 ‘SD Card Formatter’ 软件,对 SD 卡进行底层格式化,即选择 Overwrite formate 选项,执行 Formate 即可。