print()
描述
在液晶顯示器上顯示文字。
語法
lcd.print(data)
lcd.print(data, BASE)
參數
data
:要顯示在液晶顯示器上的資料,型態可為 char
, byte
, int
, string
BASE
(非必要):BASE
用來指定資料的格式;可用的格式有:BIN
(二進位格式)、OCT
(八進位格式)、DEC
(十進位格式)、HEX
(十六進位格式)
回傳
byte
:回傳輸出到液晶顯示器上的字元數
範例
#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2); void setup() { lcd.print("hello, world!"); } void loop() {}
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.