Hello everyone,
I am trying to do a Arduino project where I have to build a digital clock which displays temperature and has alarm functionality as well.
I am having trouble with replacing C with F in the LCD display after I press a button which changes the temperature format in the clock. For some reason after I press the button C blinks.
Here is the code for the temperature :-
void DisplayTemperature()
{
Changetempbuttonstate = digitalRead(SwitchTemperatureButton);
if(Changetempbuttonstate == 1)
{
if(isCelcius == true)
{
isCelcius = false;
lcd.setCursor(14, 1);
lcd.print(" ");
lcd.setCursor(15,1);
lcd.print(" ");
lcd.print("F");
}
else
{
isCelcius = true;
lcd.setCursor(14,1);
lcd.print(" ");
lcd.setCursor(15,1);
lcd.print(" ");
lcd.print("C");
}
}
Serial.println(isCelcius);
}
Your help will be much appreciated.
Thank you