How to function a 'backspace' and 'enter' on a 4x4 matrix keypad?
Are you displaying the characters somewhere as they are pressed (besides the serial monitor)?
Thank you for responding.
Yes. It displaying in LCD panel 16 x 2.
Currently I able to make key 'C' as clear. Now, I would need to do it for backspace and enter
Enter would be the newline feed or 10 (0x0A) and Backspace would be 8 (0x08). If you try to print them on the display you will most likely see garbage or nothing at all.
If you want to see a character like E or B, then once you press one of them, you can output the corresponding value. So on the display you would see E or B, but it would actually be sending out 8 or 10
Case 'B':
Serial.print(0x08)
break;
Case 'D'
Serial.print(0x0A)
break;
is it like this?
Yea, but where is the rest of the code? And the semicolons at the ends?
void loop(){
char key= myKeypad.getKey();
if (key != 0)
{
lcd.print(key);
switch(key)
{
case 'C':
lcd.clear();
lcd.setCursor(0,0);
lcd.print("BUS SERVICE:");
lcd.setCursor(0,1);
break;
case 'B':
Serial.print(0x08);
break;
case 'D':
Serial.print(0x0A);
break;
Serial.print(key);
}
}
}
this is the void loop i had done. it seems like the case B and D doesn't comply to backspace and enter respectively
I not sure about the rest of the code
This will not execute as it is in the "switch" but outside of "case"
Serial.print(key);
https://www.arduino.cc/en/Reference/SwitchCase
For:
Serial.print(0x08);
AND
Serial.print(0x0A);
.
LarryD:
This will not execute as it is in the "switch" but outside of "case"
Serial.print(key);
switch...case - Arduino ReferenceFor:
Serial.print(0x08);
AND
Serial.print(0x0A);
Serial.write() - Arduino Reference
.
Thanks for the information. I still don't get it. Would you mind assisting some code for me to execute this functions?
Lots here are willing to help.
For comments, you need to show your complete sketch.
A good photo of your wiring and any links to components, will get responses.
Also, don't start another thread like you did here, when you had another active thread on almost the same subject:
http://forum.arduino.cc/index.php?topic=348645.0
Keep it here.
Oh my.
Multiple posts is no way to solicit help!