Digital Pin to LCD

Hello I'm new and enthusiastically learning how to program Arduino. This may seem like a simple question:

I just successfully set up an LCD display from Velleman V437. I'm trying to add a digital pin, and cant seem to figure out what I am doing wrong. The pin wont work. I am attempting my first pin to go to "next" item on the menu.

The digital pin is hooked up to pin 8 of the Arduino. If you look at the coding below, I was thinking all I need to do is put it to pin 8, and make sure (uint8_t uiKeyNext = 8;). Nothing happens when I try that. Can anyone help see what I may be looking over?

The coding on the LCD:

define KEY_NONE 0

define KEY_PREV 1

define KEY_NEXT 2

define KEY_SELECT 3

define KEY_BACK 4

// DOGM128-Shield configuration values // DOGXL60-Shield configuration values uint8_t uiKeyPrev = 7; uint8_t uiKeyNext = 8; uint8_t uiKeySelect = 3; uint8_t uiKeyBack = 2;

uint8_t uiKeyCodeFirst = KEY_NONE; uint8_t uiKeyCodeSecond = KEY_NONE; uint8_t uiKeyCode = KEY_NONE;

void uiSetup(void) { // configure input keys

pinMode(uiKeyPrev, INPUT_PULLUP); // set pin to input with pullup pinMode(uiKeyNext, INPUT_PULLUP); // set pin to input with pullup pinMode(uiKeySelect, INPUT_PULLUP); // set pin to input with pullup pinMode(uiKeyBack, INPUT_PULLUP); // set pin to input with pullup }

void uiStep(void) { uiKeyCodeSecond = uiKeyCodeFirst; if ( digitalRead(uiKeyPrev) == LOW ) uiKeyCodeFirst = KEY_PREV; else if ( digitalRead(uiKeyNext) == LOW ) uiKeyCodeFirst = KEY_NEXT; else if ( digitalRead(uiKeySelect) == LOW ) uiKeyCodeFirst = KEY_SELECT; else if ( digitalRead(uiKeyBack) == LOW ) uiKeyCodeFirst = KEY_BACK; else uiKeyCodeFirst = KEY_NONE;

if ( uiKeyCodeSecond == uiKeyCodeFirst ) uiKeyCode = uiKeyCodeFirst; else uiKeyCode = KEY_NONE;

Post full code using code tags around your code: [code][color=blue]// your code is here[/color][/code].

It should look like this:// your code is here (Also press ctrl-T (PC) or cmd-T (Mac) in the IDE before copying to indent your code properly)

It does not make sense to write a bunch of code to use the value read from a pin until you KNOW that the value read from the pin is the value that you expect.

Ditch all that code for using the pin state. Use the state change detection example, and prove to yourself that the pin state changes when you think it should, and ONLY when you think it should.

Then, you can put code in to use the pin state information. Until then, you are wasting your time.