The sketch where I'm fighting with for weeks is written for a LCDscreen with buttons.
But i'm using only a big LCD screen without keypad buttons.
I only need to use two buttons SELECT and DOWN but I tried everything on port A0 as written
here i don't get it working.
The code is complicated for me so i hope somebody can point me the right direction.
I assume the changes must be made in this part of the code
LCDKeypad::LCDKeypad() : LiquidCrystal(8, 9, 4, 5, 6, 7){}
int LCDKeypad::button(){
static int NUM_KEYS=5;
static int adc_key_val[5] ={30, 150, 360, 535, 760};
int k, input;
input=analogRead(0);
for (k = 0; k < NUM_KEYS; k++){
if (input < adc_key_val[k]){
return k;
}
}
if (k >= NUM_KEYS){
k = -1; // No valid key pressed
}
return k;
}
I hope somebody can help me out
buttonprob.ino (8.86 KB)
notes.h (1.86 KB)
pitches.h (1.96 KB)
ScrollableMenu.cpp (1.62 KB)
ScrollableMenu.h (676 Bytes)



