我想找...

搜尋

分享

目錄

LiquidCrystal()

[LiquidCrystal]

描述

Creates a variable of type LiquidCrystal. The display can be controlled using 4 or 8 data lines. If the former, omit the pin numbers for d0 to d3 and leave those lines unconnected. The RW pin can be tied to ground instead of connected to a pin on the 86Duino; if so, omit it from this function’s parameters.

語法

LiquidCrystal(rs, enable, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)
LiquidCrystal(rs, enable, d0, d1, d2, d3, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)

參數

  • rs: the number of the 86Duino pin that is connected to the RS pin on the LCD
  • rw: the number of the 86Duino pin that is connected to the RW pin on the LCD (optional)
  • enable: the number of the 86Duino pin that is connected to the enable pin on the LCD
  • d0, d1, d2, d3, d4, d5, d6, d7: the numbers of the 86Duino pins that are connected to the corresponding data pins on the LCD. d0d1d2和 d3 are optional; if omitted, the LCD will be controlled using only the four data lines (d4d5d6d7).

範例

#include <LiquidCrystal.h>
 
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
 
void setup()
{
  lcd.begin(16,1);
  lcd.print("hello, world!");
}
 
void loop() {}

函式庫參考主頁面

86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。

返回頂端