示例#1
0
文件: main.cpp 项目: jucs/arduino-due
// the setup routine runs once when you press reset:
void setup() {
  // initialize the digital pin as an output.
  lcd.begin(20, 4, LCD_5x8DOTS);

  lcd.command(0x01); //clear display lcd.command (0x01) / / clear display
  delay(4 * 02);
  lcd.command(0x24); //function set RE=1 lcd.command (0x24) / / function set RE = 1
  delay(4 * 50);
  lcd.command(0x09); //extendet function set, 4 lines, 5-dot fontwith
  delay(4 * 50);
  lcd.command(0x20); //function set RE=0 lcd.command (0x20) / / function set RE = 0
  delay(4 * 50);
  lcd.command(0x0C); //control, display on, cursor off, blinken off
  delay(4 * 50);
  lcd.command(0x01); //clear display lcd.command (0x01) / / clear display
  delay(4 * 20);
  lcd.command(0x06); //entry mode segment bidirectional
}