println()

描述

寫入資料到 MicroSD 卡裡的檔案,在資料寫入完成後再寫入一個換行字元(’\n’)到檔案,該檔案必須是以寫入模式打開。當要傳送的資料為數字時,每一位數會被拆開來並各自被當作字元(例:如果要送的資料為 123 ,print() 會把 123 當作 ‘1’, ‘2’, ‘3’ 三個字元)。

語法


file.println()
file.println(data)
file.print(data, BASE)

參數

file:被 SD.open() 回傳的 File 物件

data:要傳送的資料,型態可以為 char, byte, int, longstring

BASE(非必要):BASE 用來指定資料的格式;可用的格式有:BIN(二進位格式)、OCT(八進位格式)、DEC(十進位格式)、HEX(十六進位格式)

回傳

byte:回傳 println() 寫入至檔案的位元組數量

See Also

print()
write()


函式庫參考主頁面

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.