How to make simply lcd menu with 2 buttons ?

Hi all,

I don’t know how to make a simply menu wich use 2 switches for my geiger counter.

For ex. [uSv/h ] ------> [CPS ] ------> [Max: ]
[CPM ] <------ [danger ] <------ [Min: ]

I need menu,s like this one for my other projects …

Please help :frowning:

here,s my working geiger code , im using it on atmega 8 :.

 #include <LiquidCrystal.h>
 
 #define CONV_FACTOR 0.0057
 
int led = 1;
int switchL = 10; 
int switchR= 9;
int inputGM =7;
int inputGMstate = 0;
long count=0;


long countPerMinute = 0;
long timePrevious = 0;
long timePreviousMeassure = 0;
long time = 0;
long countPrevious = 0;
float radiationValue = 0.0;



LiquidCrystal lcd(6, 8, 5, 4, 3, 2);

void setup() {   
  
 pinMode(led, OUTPUT);  
  pinMode(inputGM,INPUT); 
    pinMode(switchL,INPUT); 
      pinMode(switchR,INPUT); 
 
  lcd.begin(8, 2);
  // Print a message to the LCD.
}




void loop() {
  
  inputGMstate = digitalRead(inputGM);

  
  
   if(inputGMstate == HIGH){
   delay(20);
  count = count + 1; 
  delay(20);
 }

 
 
   if (millis()-timePreviousMeassure > 10000){
    countPerMinute = 6*count;
    radiationValue = countPerMinute * CONV_FACTOR;
    timePreviousMeassure = millis(); 
    
    lcd.clear();    
    lcd.setCursor(0, 0);
    lcd.print(radiationValue,6);

 
   lcd.setCursor(0,1);
   lcd.print(countPerMinute);
   lcd.setCursor(6,1);
   lcd.print(count);
   

   count = 0;
   
   }

Using only 2 switches/buttons will allow you to move between menus but selecting items on the menu is more difficult. It can be done but would require you to use short and long button presses or 2 buttons pressed at the same time. How do envisage it working ?

I think 2 buttons pressed at the same time ll be better to select items.

Tiger11: I think 2 buttons pressed at the same time ll be better to select items.

As a mere human, how do you propose to press the two buttons at [u]exactly/u the same time? One pressed before the other will change the menu page.

Tiger11:
Hi all,

I don’t know how to make a simply menu wich use 2 switches for my geiger counter.

For ex. [uSv/h ] ------> [CPS ] ------> [Max: ]
[CPM ] <------ [danger ] <------ [Min: ]

I need menu,s like this one for my other projects …

Please help :frowning:

I do a lot of student projects with Arduino and user controlled menus. My favorite is to use two double throw, spring return to center off switches like this:

One is used as “Up/Down” and the other is “Enter/Cancel”.

So, say a controller was built to control two motors, each with a different RPM. The menu would go like this on a 2 line LCD screen:

DOWN to CONFIG
ENTER to RUN

if ENTER is clicked, the thing just runs. If DOWN is clicked, you get:

MOT #1 RPM 0000
ENTER to CONT

The Up/Down switch changes the number. Click ENTER when done Then you get:

MOT #2 RPM 0000
ENTER to CONT

Click ENTER takes you back to the first menu:

DOWN to CONFIG
ENTER to RUN

Or, if you clicked “Cancel” you would go back to Motor #1. Cancel again and you move up to the main menu.

See? It’s really easy to configure anything with just two dual switches.

My favorite is to use two double throw, spring return to center off switches

Strictly that is cheating because although it uses 2 physical devices in practice I would regard it as 4 switches, but I would not argue over the semantics as long as it meets the OP's needs. What we don't know us why he wants to use only 2 switches. 4, or 5 buttons in a star configuration would be more natural to use I think.