I'm trying to get a pushbutton to control a switching LCD screen (when the button is pushed, the screen changes), but I'm having trouble with the logic.
if (lcdSw == HIGH) {
delay(500); //allow time for button to be depressed
lcd.clear();
state = LCD_Misc;
}
I check to see if the input on the Arduino pin is high, and if it is, I want the next screen to display. But I'm having trouble getting this to work (I feel really stupid). Right now, the screen is constantly changing if I have a wire in the pin of lcdSw. But if there isn't a wire in the pin, nothing happens (duh).
Because of this trouble, I've tried tying the pushbutton to the pin and ground thinking that the presence of a wire in the pin was making it HIGH, but this didn't work either. I had to hold down the button to get it to stay on the same screen.
Any suggestions?