wiring diagram
Code 1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
lcd.backlight();
lcd.begin();//LiquidCrystal_I2C
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("Hello LCD I2C");
lcd.setCursor(0,1);
lcd.print("Pattayatech");
}
Code 2
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int x=48;
int y=-79;
float z=8.74586;
void setup()
{
lcd.begin();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("x = ");
lcd.print(x);
lcd.setCursor(8,0);
lcd.print("y = ");
lcd.print(y);
lcd.setCursor(0,1);
lcd.print("z = ");
lcd.print(z,4);
}
Code 3
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
byte heart[8] = {0x00,0x0A,0x1F,0x1F,0x0E,0x04,0x00,0x00};
byte smile[8] = {0x00,0x11,0x00,0x00,0x11,0x0E,0x00,0x00};
void setup()
{
lcd.begin();
lcd.createChar(0,heart);
lcd.createChar(1,smile);
}
void loop()
{
lcd.setCursor(0,0);
lcd.write(0);
lcd.setCursor(0,1);
lcd.write(1);
}
Code 4
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
lcd.begin();
}
void loop()
{
lcd.home();
lcd.print("ECS");
for (int i=0;i<13;i++)
{
delay(400);
lcd.scrollDisplayRight();
}
for (int i=0;i<13;i++)
{
delay(400);
lcd.scrollDisplayLeft();
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น