Go Down

Topic: LCD Thermostat (Read 2315 times) previous topic - next topic


Hi all !!

I'm very new to lcd codes and i've made a simple thermostat but now i have a problem that I don't know how to make a menu on my LCD.
The menu should have two items so that I can manualy turn two outputs ON and OFF, with 2 buttons ( forward, select) to get to the menu I vould press both buttons.
Can you help me ?
Code: [Select]
#include <LiquidCrystal.h>
 int  ledPin = 8;
 int  TEMPTRIGGER = 25.00;
 float temperature = 0;
 LiquidCrystal lcd(10, 11, 12, 13, 14, 15, 16);

void setup()

 pinMode(ledPin, OUTPUT);
 lcd.begin(16, 2);
 lcd.print("Made By Elvis K.");

 lcd.print("Prosim pocakaj...");
 lcd.clear(); // clear LCD screen
 lcd.print("Temperatura je: ");

void loop()
 if(temperature >= TEMPTRIGGER) {
   digitalWrite( ledPin, HIGH);
   digitalWrite( ledPin, LOW);
   lcd.print("  ALARM ALARM  ");
       digitalWrite( ledPin, LOW);
       lcd.print("Temperatura je: ");

 temperature = analogRead(5); /
 temperature = temperature +252-500;
 temperature = temperature / 10;

 delay (100);
   lcd.print(" Temperature is   ");
   lcd.println(" stop. C.   ");

Thanks !


Some things to do:

You'll need to keep track of what state the display is in.  If you are displaying a menu you don't want to also be displaying the temperature.

When you are not displaying the menu you should ignore a button being pressed unless both buttons are pressed.

When you are displaying a menu you should ignore a button being pressed if it was already pressed the last time you checked or if the other button is already pressed.

You want to somehow highlight the selected line, perhaps with a ">" in the left column.  When the "next" button is pressed you want to move the pointer.  When the "select" button is pressed you want to perform the selected action and go back to displaying the temperature.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


that is exactly what i'm trying to do, but I don't know how :D



I found this but don't know how  to implant it in to my code.

Is there really nobody that wants to help me ?



Did you find solution for a problem to make a menu on LCD?

I have the same problem, can you help me?

Thank you in advace

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131