用户工具

站点工具


reference:library:sd

SD库

SD库允许在例如Arduino Ethernet Shield之类的扩展板上对SD卡进行读和写的操作。该库基于William Greiman编写的sdfatlib。该库支持在标准SD卡和SDHC卡上使用FAT16和FAT32文件系统。使用8.3格式的短文件名。传递到SD库函数的文件名可以包含由正斜杠/分隔的路径,例如“directory/filename.txt”。由于工作目录通常是SD卡的根目录,所以同一个文件的文件名包含或不包含正斜杠都是允许的(例如 “/file.txt” 等于“file.txt”)。 在版本1.0中,该库支持打开多个多个文件。

The communication between the microcontroller and the SD card uses SPI, which takes place on digital pins 11, 12, and 13 (on most Arduino boards) or 50, 51, and 52 (Arduino Mega). Additionally, another pin must be used to select the SD card. This can be the hardware SS pin - pin 10 (on most Arduino boards) or pin 53 (on the Mega) - or another pin specified in the call to SD.begin(). Note that even if you don't use the hardware SS pin, it must be left as an output or the SD library won't work. Notes on using the Library and various shields

SD 类

SD类提供访问SD卡和操作卡上文件和目录的函数。

File 类

Examples

  • Datalogger: Log data from three analog sensors to a SD card using the SD library
  • DumpFile: Read a file from a SD card using the SD library and send it over the serial port
  • Files: Create and destroy a file on a SD card
  • ReadWrite: Read and write data to and from a file on a SD card
  • CardInfo: Get information about a SD card

Reference Home

reference/library/sd.txt · 最后更改: 2017/10/04 10:01 (外部编辑)