mandulaj / PZEM-004T-v30

Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter
MIT License
256 stars 108 forks source link

LCDi2C to esp8266 - pzem004tv30 #88

Open MikeLizter123 opened 2 years ago

MikeLizter123 commented 2 years ago

//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 commented 2 years ago

figured it out haha tnx