“SD库”的版本间的差异

来自YFRobotwiki
跳转至: 导航搜索
(以“{| border="0" cellpadding="10" width="100%" |- |width="50%" valign="top" align="left"| Arduino电路板上的单片机自带EEPROM:它是一种当芯片断电时...”为内容创建页面)
 
第1行: 第1行:
 
{| border="0" cellpadding="10" width="100%"
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|-
|width="50%" valign="top" align="left"|
+
|width="60%" valign="top" align="left"|
Arduino电路板上的单片机自带EEPROM:它是一种当芯片断电时,里面的内容依然可以保存下来的一种储存器。该库可让您对EEPROM中的字节进行读取和写入。
+
  
 +
The SD library allows for reading from and writing to SD cards, e.g. on the Arduino Ethernet Shield. It is built on sdfatlib by William Greiman. The library supports FAT16 and FAT32 file systems on standard SD cards and SDHC cards. It uses short 8.3 names for files. The file names passed to the SD library functions can include paths separated by forward-slashes, /, e.g. "directory/filename.txt". Because the working directory is always the root of the SD card, a name refers to the same file whether or not it includes a leading slash (e.g. "/file.txt" is equivalent to "file.txt"). As of version 1.0, the library supports opening multiple files.
 +
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.
  
|width="30%" valign="top" align="left"|
+
 
 +
<font color="darkcyan" size="+1">'''Examples'''</font><br>
 +
 
 +
'''The SD class provides functions for accessing the SD card and manipulating its files and directories.'''
 +
 
 +
:-[[ 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
 +
 
 +
 
 +
|width="40%" valign="top" align="left"|
  
  
第59行: 第76行:
  
  
|width="20%" valign="top" align="left"|
+
|width="0%" valign="top" align="left"|
  
 
<!-- 空白 -->
 
<!-- 空白 -->

2015年7月6日 (一) 10:21的版本

The SD library allows for reading from and writing to SD cards, e.g. on the Arduino Ethernet Shield. It is built on sdfatlib by William Greiman. The library supports FAT16 and FAT32 file systems on standard SD cards and SDHC cards. It uses short 8.3 names for files. The file names passed to the SD library functions can include paths separated by forward-slashes, /, e.g. "directory/filename.txt". Because the working directory is always the root of the SD card, a name refers to the same file whether or not it includes a leading slash (e.g. "/file.txt" is equivalent to "file.txt"). As of version 1.0, the library supports opening multiple files. 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.


Examples

The SD class provides functions for accessing the SD card and manipulating its files and directories.

- 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



SD Class

The SD class provides functions for accessing the SD card and manipulating its files and directories.

- begin()
- exists()
- mkdir()
- open()
- remove()
- rmdir()


File class

The File class allows for reading from and writing to individual files on the SD card.

- available()
- close()
- flush()
- peek()
- position()
- print
- println()
- seek()
- size()
- read()
- write()
- isDirectory
- openNextFile()
- rewindDirectory()






返回库菜单