Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCDi2C to esp8266 - pzem004tv30 #88

Open
MikeLizter123 opened this issue May 20, 2022 · 1 comment
Open

LCDi2C to esp8266 - pzem004tv30 #88

MikeLizter123 opened this issue May 20, 2022 · 1 comment

Comments

@MikeLizter123
Copy link

//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;

@MikeLizter123
Copy link
Author

figured it out haha tnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant