LCDi2C to esp8266 - pzem004tv30
MikeLizter123 opened this issue · 1 comments
//cant seem to display outputs to lcd, stays in one position.
//this is based on MultiDevice Example from the pzem004tv30 library by Mandulaj
//sorry if this is trivial for some of you guys, im a newbie
if (show == 0) {
lcd.setBacklight(255);
lcd.home(); lcd.clear();
lcd.print("");
lcd.setCursor(0,1); lcd.print("");
delay(1000);
lcd.setBacklight(0);
delay(400);
lcd.setBacklight(255);
} else if (show == 1) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Voltage: "); lcd.print(voltage); lcd.println("V");
lcd.setCursor(0, 1);
lcd.print("Current: "); lcd.print(current); lcd.println("A");
} else if (show == 2) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Power: "); lcd.print(power); lcd.println("W");
lcd.setCursor(0, 1);
lcd.print("Energy: "); lcd.print(energy,3); lcd.println("kWh");
} else if (show == 3) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Frequency: "); lcd.print(frequency, 1); lcd.println("Hz");
lcd.setCursor(0, 1);
lcd.print("PF: "); lcd.println(pf);
}
delay(1500);
show = (show + 1) % 4;
figured it out haha tnx