欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: lcd.begin(16, 2); [打印本頁]

作者: lsb1214    時(shí)間: 2017-10-23 20:20
標(biāo)題: lcd.begin(16, 2);
//DFRobot.com
//Compatible with the Arduino IDE 1.0
//Library version:1.1


#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x3F for a 16 chars and 2 line display

void setup(){

  lcd.init();                      // initialize the lcd
  lcd.backlight();
  lcd.begin(16, 2);
  lcd.home();
   lcd.setCursor(2, 0);
  lcd.print("Hello world...");
  lcd.setCursor(2, 1);
  lcd.print("dfrobot.com");

}

int backlightState = LOW;
long previousMillis = 0;
long interval = 1000;

void loop()
{

  unsigned long currentMillis = millis();

  if(currentMillis - previousMillis > interval)
  {
    previousMillis = currentMillis;   

    if (backlightState == LOW)
      backlightState = HIGH;
    else
      backlightState = LOW;

    if(backlightState == HIGH)  lcd.backlight();
    else lcd.noBacklight();
  }
}





歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1