Projet

Général

Profil

« Précédent | Suivant » 

Révision 616

Ajouté par megoutteno il y a presque 4 ans

Correction fonction lcd_8b

Voir les différences:

branch/Gouttenoire/sp4b2/SP4b2/SP4b2/SP4b2.c
/* pd1=0xff; // definit en sortie
p1_2=1; //E=1
p1_7=1; */
pd1=0xff;
lcd_4b(0xAA); // test fonction 4bits
lcd_8b(0xAA); // test fonction 8bits
lcd_8b(0x8F); // test fonction 8bits
}
void lcd_4b(unsigned char car)
{
pd1=0xff; // definit en sortie
if(car & 0x80)
{
p1_7=1;
......
}
void lcd_8b(unsigned char car)
{
pd1=0xff; // definit en sortie
if(car & 0x80)
{
p1_7=1;
}
else
{
p1_7=0;
}
if(car & 0x40)
{
p1_6=1;
}
else
{
p1_6=0;
}
if(car & 0x20)
{
p1_5=1;
}
else
{
p1_5=0;
}
if(car & 0x10)
{
p1_4=1;
}
else
{
p1_4=0;
}
if(car & 0x08)
{
p1_3=1;
}
else
{
p1_3=0;
}
if(car & 0x04)
{
p1_2=1;
}
else
{
p1_2=0;
}
if(car & 0x02)
{
p1_1=1;
}
else
{
p1_1=0;
}
if(car & 0x01)
{
p1_0=1;
}
else
{
p1_0=0;
}
}
lcd_4b(car);
lcd_4b(car<<4);
}

Formats disponibles : Unified diff