Hello, I am having trouble with my LCD keypad, specifically that I have written the sketch and it is compiling with no errors, but the buttons are not displaying anything. I essentially just want to use the up and down to allow the user to be able to scroll on my menu page between 2 sensor options, temperature and heart rate. I have attached my code and even replaced the case of the down button to just print something just to individually test it but it is not printing anything. I would appreciate some help as to what my issue is. Thanks!
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
#define RIGHTbutton 0
#define UPbutton 1
#define DOWNbutton 2
#define LEFTbutton 3
#define SELECTbutton 4
#define NObutton 5
//buttons are connected by analog pin 0
double ButtonValues_adc = 0;
int ButtonValues_lcd = 0;
void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Sensor Options: ");
lcd.setCursor(0, 1);
lcd.print("> Temperature ");
//lcd.setCursor(0, 2);
//lcd.print("> Heart Rate");
//delay(500);
}
void loop() {
// put your main code here, to run repeatedly:
static int col = 0;
static int row = 0;
//lcd.setCursor(0, 1);
ButtonValues_lcd = LCD_ReadButtons();
switch (ButtonValues_lcd) {
case DOWNbutton:
{
lcd.blink();
lcd.setCursor(col, row);
break;
}
case UPbutton:
{
lcd.blink();
lcd.setCursor(col, 0);
}
case RIGHTbutton:
{
lcd.setCursor(col++, row);
break;
}
case LEFTbutton:
{
lcd.setCursor(col--, row);
break;
}
}
//delay(500);
}
int LCD_ReadButtons() { //function that determines which button is pressed
ButtonValues_adc = analogRead(0);
if (ButtonValues_adc > 1000) return NObutton;
if (ButtonValues_adc < 850) return SELECTbutton;
if (ButtonValues_adc < 650) return LEFTbutton;
if (ButtonValues_adc < 450) return DOWNbutton;
if (ButtonValues_adc < 250) return UPbutton;
if (ButtonValues_adc < 50) return RIGHTbutton;
return NObutton;
}