Hi all,
I have this program i have written which is to sense two analogue inputs and display them on my 4x16 lcd.
I cant seem to change the delay at the end to millis.
At the moment the words 'Temp' and 'Ph' refresh at the same rate as the input temp from my LM35.
Any idea how i can stop those words refreshing and just keep them as constant words on the screen, but allowing the actual temp value to change????
#include <LCD4Bit.h>
LCD4Bit lcd = LCD4Bit(2);
int Water_Temp_Pin = 2; // Select the input pin for the temperature ( Pin 2)
int Water_Temp_Val;
void setup() {
lcd.init();
}
void loop() {
lcd.clear();
lcd.printIn("..AQUATROLLER..");
lcd.cursorTo(1,16);
lcd.printIn ("Temp:");
lcd.cursorTo(2,16);
lcd.printIn ("Ph:");
int i, Water_Temp_Val = 0;
for(i = 0; i < 20; ++i)
{
Water_Temp_Val = analogRead(Water_Temp_Pin); // Read the value from the sensor
}
if(Water_Temp_Val /= 2) // Temperature in deg C/2 to give accurate temp display
int heat = Water_Temp_Val;
char heat_str[5] = " "; // Reserve the string space first
itoa(Water_Temp_Val, heat_str, 10);
lcd.cursorTo(1,30); // Move cursor to display temp
lcd.printIn(heat_str); // Displays temp
delay (1000);
}
Any help would be great!
VR