altron11 WROTE:Hi Ober and sharul,
Thanks for the advises and help.
I managed to get the keypad working. now i need to keyin the values and compare it against the readings measured from a sensor. But i am unable to display the keyin values and compare against the sensor reading. Would need your help on this.
shahrul WROTE:altron11 WROTE:Hi Ober and sharul,
Thanks for the advises and help.
I managed to get the keypad working. now i need to keyin the values and compare it against the readings measured from a sensor. But i am unable to display the keyin values and compare against the sensor reading. Would need your help on this.
How you show the keypad working? You show on 7 segment or LCD?
while(1)
{
lcdclear(); // lcd clear function
lcddispstring( " hello world"); // display a string to lcd
/*some other functions of keypad*/
}
yonghui WROTE:hi,
i think u will need to sharing portion of of code,
mayb u have some clear lcd function in an infinite loop that continuously clear the lcd after u display the char u wanted, try to debug that.
for example:
- CODE: SELECT_ALL_CODE
while(1)
{
lcdclear(); // lcd clear function
lcddispstring( " hello world"); // display a string to lcd
/*some other functions of keypad*/
}
this will cause the lcd to be cleared every time after u display it onto lcd.
is this happen to ur code? or something similar?
or pls do make sure that the program does not hang after goes into ur keypad function.
try to debug with lighting LED on and off after goes out from the keypad funtion.
regards,
yonghui
lcd_clr(); //clear LCD
delay(1000); //delay
lcd_goto(0); //initial display
send_string("PLEASE ENTER"); //Display "PLEASE ENTER" on lcd
lcd_goto(20); //Display on 2nd line
send_string("2 DIGIT SPEC");
while(1)
{ //keypad scanning
clearrow1(); //Clear 1st output pin and set the others
scancolumn1(); //scan column 1-4
clearrow2(); //Clear 2nd output pin and set the others
scancolumn2(); //scan column
clearrow3(); //Clear 3rd output pin and set the others
scancolumn3(); //scan column
clearrow4(); //Clear 4th output pin and set the others
scancolumn4(); //scan column
if(num_count==2)
{
delay(8000);
//while(1)
//{
//lcd_clr();
lcd_goto(0); //cursor start from beginning
//display character on LCD
send_char(' ');
send_char('S');
send_char('P');
send_char('E');
send_char('C');
send_char('.');
send_char('.');
send_char('=');
lcd_goto(20); //cursor go to 2nd line of the LCD
//display character on LCD
send_char(' ');
send_char('M');
send_char('E');
send_char('A');
send_char('S');
send_char('U');
send_char('R');
send_char('E');
send_char('D');
send_char('=');
Users browsing this forum: No registered users and 4 guests