Hey guys,
i am new to arduino. i am currently working on a small project. basically i am using the 4 x 4 keypad for the input and LCD for display. so once the program runs the user enters two value. so first input is 2 digit input which arduino saves in an array and similarly the second input is a four digit input that is saved into the second array. The program runs successfully and reads the first input correctly though the second input does not work.
if (int(key1) != 0 and currentState == 1) {
switch (key1) {
case '*':
// sets the first array to zero
currentState = 1;
break;
case '#':
//saves the value into the first array
//sets the currentState to 2
currentState = 2;
if (currentState = 2){
switch (key1){
case '*':
//sets the second array to zero
currentState = 2;
break;
case '#':
//saves the value into the second array
currentState = 1;
break;
case 'A':
//goes back to the menu
break;
default:
currentTValue[0] = currentTValue[1];
currentTValue[1] = key1;
break;
}
}
break;
case 'A':
//goes back to the menu
break;
default:
currentT2Value[0] = currentT2Value[1];
currentT2Value[1] = currentT2Value[2];
currentT2Value[2] = currentT2Value[3];
currentT2Value[3] = key1;
break;
}
}
}