be80be
Well-Known Member
Here the problem if I add the " else statement I get the waiting on key" but it doesn't go back and test the
"if (c != 0xFF) "
It never prints key press
If I leave out the else statement it prints key and **** pot of 0xFF
"if (c != 0xFF) "
It never prints key press
If I leave out the else statement it prints key and **** pot of 0xFF
Code:
void main()
{
ScanKeyMatrixInit();
UART_Init(9600);
char c;
if (c != 0xFF) {
c = ScanKeyMatrix();
printf("%d\n",c);
__delay_ms(100);
}
else if (c == 0xFF)
{
UART_Write_Text("waiting on key\n");
__delay_ms(100);
}