/******************************
Pengujian LCD I2C
******************************/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
float T = 0.0;
char str[10];
int htr;
void setup() {
lcd.init();
lcd.backlight();
//Setup Awal Ketika Running
about();
lcd.setCursor(0,0);
lcd.print("S=xx.xC");
lcd.setCursor(0,1);
lcd.print("H=xx.xC A=xx.x%");
}
void loop(){
T += 0.1;
htr += 10;
if(htr>100)
htr=0;
lcd.setCursor(2,0);
dtostrf(T,4,1,str);
lcd.print(str);
lcd.setCursor(2,1);
dtostrf(100-T,4,1,str);
lcd.print(str);
lcd.setCursor(10,1);
sprintf(str,"%3d", htr);
lcd.print(str);
delay(400);
}
void about(){
lcd.setCursor(0,0);
lcd.print("Kontrol Suhu");
lcd.setCursor(0,1);
lcd.print("SKD-2AD4TE 2023");
lcd.clear();
delay(4000);
}