I am trying to use buttons to print to an lcd screen. I have 3 buttons - 1 Up button, 1 Down button and a select button. But for some reason when the buttons are pressed nothing appears on the lcd display
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int buttonDown = 8;
const int buttonEnter = 9;
const int buttonUp = 10;
int answer = 0;
void setup() {
Serial.begin(9600);
pinMode(buttonDown, INPUT);
pinMode(buttonEnter, INPUT);
pinMode(buttonUp, INPUT);
lcd.begin(16, 2);
}
void loop() {
Setup();
}
void Setup() {
int down = digitalRead(buttonDown);
int enter = digitalRead(buttonEnter);
int up = digitalRead(buttonUp);
if (up == HIGH) {
answer++;
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(answer);
delay(150);
}
if (down == HIGH) {
answer--;
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(answer);
delay(150);
}
}