#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(32,16,2);
byte yearChar[8]={B01000,B11111,B00010,B01111,B01010,B11111,B00010,B00000};
byte moonChar[8]={B01111,B01001,B01111,B01001,B01111,B01001,B11101,B00000};
byte dayChar[8]={B01111,B01001,B01001,B01111,B01001,B01001,B01111,B00000};
int years=2023;
byte moons=11;
byte days=29;
void setup()
{
lcd.init();
lcd.backlight();
lcd.createChar(0,yearChar);
lcd.createChar(1,moonChar);
lcd.createChar(2,dayChar);
}
void loop()
{
lcd.setCursor(0,0);
lcd.print(years);
lcd.write(byte(0));
lcd.print(moons);
lcd.write(byte(1));
lcd.print(days);
lcd.write(byte(2));
}
沒有留言:
張貼留言