SdFatライブラリの使い方

Exampleライブラリを色々試してみる。

1. getline.pde

スケッチをアップロード後、シリアルで接続

Type any character to start
Line 1 (10 chars): short line
Line 2 (0 chars): 
Line 3 (17 chars): 17 character line
Partial long line (17 chars): too long for buff
Line 4 (2 chars): er
Partial final line (15 chars): line with no nl

SDカードの中身をのぞいてみたら、
GETLINE.TXTというのが作成されていた。
makeTestFile()関数でファイルを作成し、testGetFile()関数でファイルの中身を呼んでいる。

例えばココにRMLを記述しておいて、一行ずつパースしていくコードが書けそう。

2. fgets.pde

ファイルの内容を一行ずつ読み取り、改行コードが含まれているかいないかをチェックするサンプルらしい。

Type any character to start

Lines with '>' end with a '\n' character
Lines with '#' do not end with a '\n' character

>Line with CRLF
>Line with only LF
#Long line that will requ
>ire an extra read
>
#Line at EOF without NL

Done