Go Down

Topic: Keypad with LCD - sequential screens, not menu-based. (Read 82 times) previous topic - next topic

soopirV900

Hi all- I'm starting to play with LCD and a 4x4 Keypad, and am fundamentally stuck.  I haven't really got any code to share, and have successfully confirmed that my LCD and keypad work together using some sketches I've found on the net.  I can read and display character presses, store them to variables and do some basic calculations. 
I'm looking to have a series of screens that provide information, and wait for a specific character from the keypad before moving to the next screen.  My keypad has the regular numerals and A-D.  I want to advance to the next screen (20x4 i2C) when "A" is received.
I have googled around for 3 days, and I can't find any similar projects on which to learn and model.  Anyone have any advice on how to move forward?  My ultimate goal is to use "A" to advance, and "B" to go back to the previous display...this is kind of embarrassing because if I were using basic, I think I could do it  :smiley-confuse:   Thanks in advance!!

horace

make of note of the menu being displayed and update it when A is pressed
Code: [Select]
void setup() {
    displayMenu(menuDisplayed);
}

int menuDisplayed=1;
void loop() {
  if(keypad() == 'A')
      displayMenu(++menuDisplayed);
    ...
}

you need to add a check so that A does not move past the end of the menus, etc

Go Up