PORTB&=0xf0;
Pot_Read=PORTB;
switch( PORTB)
{
case 0xe0:column=0;break;
case 0xd0:column=1;break;
case 0xb0:column=2;break;
case 0x70:column=3;break;
default:break;
}
PORTB = 0x0e;
if(Pot_Read==PORTB) row=0;
PORTB = 0x0d;
if(Pot_Read==PORTB) row=1;
PORTB = 0x0b;
if(Pot_Read==PORTB) row=2;
PORTB = 0x07;
if(Pot_Read==PORTB) row=3;
Pot_Read&=0xf0;
/*switch(Pot_Read)
{
case 0xe0:row=0;break;
case 0xd0:row=1;break;
case 0xb0:row=2;break;
case 0x70:row=3;break;
default:break;
} */
Code_Fin=(row*4+column);
delaynms(10);
PORTA=Word_Shape[Code_Fin];
//LCD_Wstr(0,0,"Code_Fin");
//delaynms(1000);
/*switch(Code_Fin) {
case 0: LCD_Wstr(8,0,"0");break;
case 1: LCD_Wstr(8,0,"1");break;
case 2: LCD_Wstr(8,0,"2");break;
case 3: LCD_Wstr(8,0,"3");break;
case 4: LCD_Wstr(8,0,"4");break;
case 5: LCD_Wstr(8,0,"5");break;
case 6: LCD_Wstr(8,0,"6");break;
case 7: LCD_Wstr(8,0,"7");break;
case 8: LCD_Wstr(8,0,"8");break;
case 9: LCD_Wstr(8,0,"9");break;
case 10 CD_Wstr(8,0,"10");break;
case 11: LCD_Wstr(8,0,"11"); break;
case 12: LCD_Wstr(8,0,"12"); break;
case 13: LCD_Wstr(8,0,"13"); break;
case 14: LCD_Wstr(8,0,"14"); break;
case 15: LCD_Wstr(8,0,"15"); break;
default:break;
}*/
// }
}
}
}
}
/*void display(void)
{
uchar state;
state=key();
DDRB=0Xff;
PORTB=0x00;
delaynms(10);
PORTB=0xc0;
PORTB=Word_Shape[Code_Fin];
}*/
void main(void)
{
//LCD_init();
for(;;)
key();