งานที่9
9-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");
}
9-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);
}
ความคิดเห็น
แสดงความคิดเห็น