Hopefully my last question for this project. Thanks for all your help so far.
I have posted my code below. Simply, the LCD is not updating the valve, however through the serial monitor shows to be working fine. I have another value reading temperature the same way but through a digital port and it is updating fine... any immediate problems anyone can see?
float EngPre; // ENGINE BATTERY VOLTAGE 1
float Eng2; // ENGINE BATTERY VOLTAGE 2
float EngTemp; // ENGINE BATT TEMP MEASUREMENT HOLDER
void loop() {
EngPre = analogRead (1);
EngTemp = (EngPre / 4.092);
Eng2 = (EngTemp / 10);
lcd.setCursor(0, 3);
lcd.print("Les: Eng: ");
lcd.setCursor(15, 3);
lcd.print(Eng2);
}
That is not your code, as it is not a complete program.
Please read the "How to use this forum" post and follow the directions.
unfortunately the full code exceeds the message limit.
Hi there!
Try calling lcd.clear() before writing the values, which clears all characters and/or digits from the LCD screen, and then print the updated values.
Unfortunately this doesn't seem to fix the problem, but thanks.
unfortunately the full code exceeds the message limit.
Then post the minimal example of code that can be compiled and demonstrates the problem, as discussed in the "How to use this forum" post.
Thank you.
Now please describe what you mean by "Simply, the LCD is not updating the valve".
I'll assume you meant "value", so which particular value is not being updated, and which particular line of that lengthy code seems to be failing?
So,
lcd.setCursor(15, 3);
lcd.print(Eng2);
Should display the voltage, but it only displays it once and never updates even though it is in a loop.
lcd.setCursor(2, 2);
lcd.print(Temp);
However in the same loop updates perfectly.
never updates even though it is in a loop.
And how do you know this? If the same value is being printed over and over, it does not appear to update.
As I mentioned earlier, I added it to the serial monitor to check exactly that, and the variable "Eng2" does indeed update with the differ in input"
Have you confirmed that the left button pin is wired correctly, and that it does read low when pressed. The lcd display of eng2 is inside a button conditional. Are you indeed entering that section?
Yes, the other variables (Temp & Humi) are also running inside the same If and are updating fine.
Okay, I think its something to do with the DHT sensor reading differently to the voltage sensor. By moving the print up it seems to work. Thanks for the assistance