Hello guys
I am doing a project which will be using a keypad to enter number and character to a LCD display. However I encountered a problem which is that when I want to enter the 2nd character, it will overwrite with the 1st character. I believe is something wrong with my programming.
Here is my programming, I am a amateur programmer so I hope you guys can help me along.
- include "mbed.h"
- include "TextLCD.h"
- include "keypad.h"
DigitalOut myLed(LED1);
Keypad telepad(p28, p27, p26, p25,
p24, p23, p22, p21);
TextLCD lcd(p15, p16, p17,
p18, p19, p20);
int main (){
char key;
lcd.printf("Loading...");
wait(2);
lcd.cls();
while (1)
{
key = telepad.getKey();
if (key != KEY_RELEASED)
lcd.printf("%c\n\n", key);
}
}
Hello guys
I am doing a project which will be using a keypad to enter number and character to a LCD display. However I encountered a problem which is that when I want to enter the 2nd character, it will overwrite with the 1st character. I believe is something wrong with my programming.
Here is my programming, I am a amateur programmer so I hope you guys can help me along.
DigitalOut myLed(LED1);
Keypad telepad(p28, p27, p26, p25, p24, p23, p22, p21);
TextLCD lcd(p15, p16, p17, p18, p19, p20);
int main (){
char key;
lcd.printf("Loading..."); wait(2); lcd.cls();
while (1) { key = telepad.getKey();
if (key != KEY_RELEASED)
lcd.printf("%c\n\n", key);
} }