mr_dm
May 19, 2021, 11:28am
#1
void loop() {
char customKey = customKeypad.getKey();
switch(customKey){
case '1':
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Number of Drops");
lcd.setCursor(0,1);
lcd.print("1. 350");
lcd.setCursor(0,2);
lcd.print("2. 300");
lcd.setCursor(0,3);
lcd.print("3. 250");
char customKey1 = NO_KEY;
customKey1= customKeypad1.getKey();
switch(customKey1){
case '1':
lcd.clear();
lcd.print("nice work");
d350();
break;
}
break;
}
if (customKey == 'c'){
clr();
}
}
//////////////////////////////////
That is my loop codes but when I choose 1 in my keypad it goes through all procedures which is not my target.
any help fellows?
Your post was MOVED to it's current location as it is more suitable. What made you think that it had anything to do with the emergency response to Covid ?
Could you also take a few moments to Learn How To Use The Forum .
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Post ALL of your code using code tags when you do
gcjr
May 19, 2021, 12:28pm
#3
not clear. what are your procedures?
looks like you have two keyapds: "customKeypad" and "custom Keypad1". is this correct?
looks like pressing '1' prints 350, 300 and 250 and then the code waits for key press on the 2nd keypad and invoked 350() if a 1 is pressed
why is the case for 'c' not part of the main switch statement?
Try calling .waitForKey() instead of .getKey()
mr_dm
May 19, 2021, 3:55pm
#5
No that was mistake coz I have used the whole day try to solve that. I have only one keypad and it is
void loop() {
char customKey = customKeypad.getKey();
switch(customKey){
case '1':
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Number of Drops");
lcd.setCursor(0,1);
lcd.print("1. 350");
lcd.setCursor(0,2);
lcd.print("2. 300");
lcd.setCursor(0,3);
lcd.print("3. 250");
// trying to reset keypad value
char customKey = NO_KEY;
customKey= customKeypad1.getKey();
switch(customKey){
case '1':
lcd.clear();
lcd.print("nice work");
d350();
break;
}
break;
}
if (customKey == 'c'){
clr();
}
}
And the rest of your code ?
Did you deliberately not use code tags when you posted your partial code ?
mr_dm
May 19, 2021, 4:02pm
#7
yeah I thought the problem is there but is you need to see it all I can do that
mr_dm
May 19, 2021, 4:05pm
#8
forgive my poor third country engilish but now i get your point
gcjr
May 19, 2021, 4:14pm
#9
it helps (much) if the posted code compiles
what procedures?
system
Closed
September 16, 2021, 4:14pm
#10
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.