Révision 644
Ajouté par chsabot il y a plus de 4 ans
| SP4b1.c | ||
|---|---|---|
|
//Clavier
|
||
|
char t;
|
||
|
char touche;
|
||
|
char memotouche;
|
||
|
void main(void){
|
||
|
|
||
|
|
||
|
|
||
|
memotouche=0;
|
||
|
|
||
|
pd10=0x0F;
|
||
|
pu31=1;
|
||
|
p10=0x00;
|
||
|
p10=0xd0;
|
||
|
pd3=0xff;
|
||
|
lcd_init();
|
||
|
while(1){
|
||
|
p10=0xd0;
|
||
|
t=p10;
|
||
|
if(t!=0xF0){
|
||
|
p10=0xFE;
|
||
|
t=p10;
|
||
|
if(t==0xDE){
|
||
|
touche='2';
|
||
|
lcd_car(touche);
|
||
|
}
|
||
|
if(t==0x7E){
|
||
|
touche='3';
|
||
|
lcd_car(touche);
|
||
|
}
|
||
|
if(t==0xBE){
|
||
|
touche='1';
|
||
| ... | ... | |
|
if(t==0xBD){
|
||
|
touche='4';
|
||
|
}
|
||
|
p10=0xF7;
|
||
|
t=p10;
|
||
|
if(t==0xE7){
|
||
|
touche='*';
|
||
|
}
|
||
|
if(t==0xD7){
|
||
|
touche='*';
|
||
|
}
|
||
|
|
||
|
if(touche!=memotouche)
|
||
|
{
|
||
|
|
||
|
lcd_car(touche);
|
||
|
}
|
||
|
memotouche=touche;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
Formats disponibles : Unified diff
Modification clavier