Pulse counter with 1602 lcd keypad shield, how to add a button?

Dear all:
I’ll try to explain my needs/unsolved problems as schematic as posible, so you can understand it better.
Purpose of my sketch: pulse counting (rpm) of a wheel with an LCD 1602 display with keypad and connected to an excel spreadsheet.

Actual state: sketch (1st code) who works perfectly and fulfills my needs,but…

Problems/needs:
-I would like to configure 2 buttons of the keypad for adding/substracting 1 unit on every push of each button
I would like to store the value of the counter on the EEPROM (by pushing another of the buttons) and to recover this value if I reset or connect again the arduino sketch.
I tried to use parts of the following (2nd)code but with no luck.

Could you help me with the sketch, adding this buttons ? They have to do following:
Button UP: calibr = calibr + 0.001;
Button DOWN: calibr = calibr - 0.001;
Button LEFT = (store counter in eeprom)

Thank you very much in advance!!

/*  Pulse counter with 1602 lcd1602 keypad shield*/

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

const float calibr = 1.673;   // calibration factor
const int  sensor = 2;    

long pulsecounter = 0;   // pulse counter
int actualcounter = 0;         // actual state of counter
int previouscounter= 0;     // previous state of counter
int second = 0;
int minute = 0;
int msg=0;
float meters = 0.00;
long lastEvent = 0;  // time for last pulse
int interval = 30;    // debounce time for ignore double pressing

void setup()
 {
  Serial.begin(19200);
  pinMode(sensor, INPUT);    // initializing sensor as input
  lcd.begin(16, 2); // lcd library starting
  lcd.setCursor(0,0);
  lcd.print("C="); 
  lcd.setCursor(2,0);
  lcd.print(calibr,3);
  if(msg==0)       //welcome message show only once
     {
       lcd.setCursor(0,0);
       lcd.print("Counter");
       lcd.setCursor(1,1);
       lcd.print("Reset OK");
       delay(1000); 
       msg = 1;
       lcd.clear();
       lcd.setCursor(0,0);
  lcd.print("C="); 
  lcd.setCursor(2,0);
  lcd.print(calibr,3);
     } 
}

void loop()
 {
  actualcounter = digitalRead(sensor);  
  minute = millis() / 60000 ;
  second = (millis() / 1000 ) - ( minute* 60 ) ;
  lcd.setCursor(11,1);  
      if (minute < 10) lcd.print("0");    // if minutes <10 it writes a "0" before
       lcd.print(minute);                 // without this code it would be: H:M:S  (1:M:S)
       lcd.print(":");
      if (second < 10) lcd.print("0");  // same reason as above
       lcd.print(second);
  
  actualcounter= digitalRead(sensor); // digital read of sensor state
 if (actualcounter != previouscounter) // compares actual state with it previous
    {

 if (actualcounter == HIGH && millis() - lastEvent > interval) 
 // ignores a second press if it’s too close to the previous
         {
  lastEvent = millis();  // writes time for last valid pulse/press
    counterr++;
      meters= counter * calibr / 1000 ;
      Serial.println(counter);
              {
  lcd.setCursor(0,1); //  cursor on second line "1" and  0 spaces
  lcd.print("Dis="); 
  lcd.setCursor(4,1) ;
  lcd.print(meters,2);
  lcd.setCursor(8,0);
  lcd.print("P=");
  lcd.setCursor(10,0);
  lcd.print(pulsecounter);
            }
        } 
    }  
  previouscounter = actualcounter; 
 // saves the actual state as the previous one through the loop      
}

and the second one which I tried to use some code..but without results... (uploading itself alone it works fine!)

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int lcd_key     = 0;
int adc_key_in  = 0;
int msg = 0 ;
float calibr = 1.673;
#define btnRIGHT  0
#define btnUP     1
#define btnDOWN   2
#define btnLEFT   3
#define btnSELECT 4
#define btnNONE   5
int read_LCD_buttons()
{
 adc_key_in = analogRead(0);     
 if (adc_key_in > 1000) return btnNONE; 
 if (adc_key_in < 50)   return btnRIGHT;  
 if (adc_key_in < 195)  return btnUP; 
 if (adc_key_in < 380)  return btnDOWN; 
 if (adc_key_in < 555)  return btnLEFT; 
 if (adc_key_in < 790)  return btnSELECT;   
 return btnNONE;  
 msg=0;
}
void setup()
{
 lcd.begin(16, 2);          
 lcd.setCursor(0,0);
 lcd.print("Press buttons");
}
 
void loop()
{
 lcd.setCursor(9,1);            
 lcd.print(millis()/1000);      
 lcd.setCursor(0,1);            
 lcd_key = read_LCD_buttons();  
 switch (lcd_key)               
{
   case btnRIGHT:
      {
     calibr = calibr + 0.0002;
     delay ( 250) ;
      lcd.setCursor(0,0);
  lcd.print("C="); 
  lcd.setCursor(2,0);
  lcd.print(calibr,3);
  break ;
          }
   case btnLEFT:
   {
     calibr = calibr - 0.0002;
     delay ( 250) ;
      lcd.setCursor(0,0);
  lcd.print("C="); 
  lcd.setCursor(2,0);
  lcd.print(calibr,3);
     break;
     }
   case btnUP:
     {
     millis()=0;

     break;
     }
   case btnDOWN:
     {
     lcd.print("DOWN  ");
     break;
     }
   case btnSELECT:
     {
     lcd.print("SELECT");
     break;
     }
   case btnNONE:
     {
     lcd.print("NONE  ");
     break;
     }
 }
}

I tried to use parts of the following (2nd)code but with no luck.

There is absolutely no luck involved.

You need to determine that a switch (the shield has no buttons) has been pressed. You give no evidence that you know that that happens.

You need to increment or decrement a value. You give no evidence whether that is working, or not.

You need to write some data to EEPROM, under some condition(s). You give no evidence whether that is working, or not.

You need to read some data from EEPROM, in setup. You give no evidence whether that is working, or not.

Sorry, but I feel a really bit upset.
I'm not a native english and my programming language is very limited.
I guess, most of you know a lot about everything involved with arduino, but for me it's a great challenge.
I'm trying to learn every day a little bit of this...since 2 years, but I have any support from any side.
So I only expect to have a little support from this forum,to solve my problem.
With this answer I don't know what I have to do or write...
I only want to learn how to implement a button to my sketch...

I only want to learn how to implement a button to my sketch...

No. You want a lot more than that. But, it seems that you want others to do it for you. If that is really what you want, go over to Gigs and Collaboration, and offer to hire someone to write your code for you.

If you want to learn, then look at the documentation that came with your shield, and learn how to read which switch is pressed.

When you can do that, you need an if statement to perform some action if the increment switch is pressed. You need an if statement to perform some action if the decrement switch is pressed.

You need to define WHAT you want to save to EEPROM, and at least put a comment in the code where that needs to happen.

You need to define WHAT you want to read from EEPROM, and at least put a comment in the code where that needs to happen.

If you make some attempt, we'll be happy to tell you what is wrong, if anything, and how to fix it, if needed.

thanks Paul.
No, I don't want that someone write the code for me.But, as we say in Spain, " Nobody was born learned" and "Nobody knows all from all".
that's my case: I know something abot my studies : Chemistry, calibrations and Quality engineering. So please try to understand if you would need some help in Chemistry ,maybe a trivial question for me , would be the most difficult thing t ounderstand for you.
I know, that you're spending your time giving some support for nothinh and I don't know how to thank you for this.
But that's not the question

I only want a tip, how to go ahead for programming some buttons.
I'll make some atemps this weekend and telling you what is going wrong on the sketch.
Nowadays I melt both sketches together, compiles correctly, but nothing happens on the LCD..
Well I'll come back with concrete problems.

Best regards

David