Hi, I got this screen attached to my uno. The full code is at the bottom of the link https://arduino-info.wikispaces.com/LCD-Pushbuttons
I want to display a starting value of 25g on the screen and then when I:
- Push the up button - I want it to add 5g to the start value and display this (and then wait for new input)
- Push the down button - remove 5g (and wait for new input) So same solution as in 1.
- Push select - Move on in the code.
My question and the problem, can I somehow perform an action when a button is pressed and then stay in the switch? Or should I use a different approach.
switch (lcd_key) // depending on which button was pushed, we perform an action
{
case btnRIGHT:
{
lcd.print("RIGHT ");
break;
}
case btnLEFT:
{
lcd.print("LEFT ");
break;
}
case btnUP:
{
lcd.print("UP ");
break;
}
case btnDOWN:
{
lcd.print("DOWN ");
break;
}
case btnSELECT:
{
lcd.print("SELECT");
break;
}
case btnNONE:
{
lcd.print("NONE ");
break;
}
}/* --(end switch )-- */