Projet

Général

Profil

« Précédent | Suivant » 

Révision 887

Ajouté par nibenmbare il y a environ 4 ans

fin dernier tp

Voir les différences:

SP4b2.c
void lcd_4b(unsigned char c)
{
char c;
pd1 = 0xff;
p1_2 = 1;
c = 0b00100000;
{
char c;
pd1 = 0xff;
p1_2 = 1;
c = 0b00100000;
if (c & 0b10000000)
p1_7 = 1;
else
p1_7 = 0;
if (c & 0b10000000)
p1_7 = 1;
else
p1_7 = 0;
if (c & 0b01000000)
if (c & 0b01000000)
p1_6 = 1;
else
p1_6 = 0;
p1_6 = 1;
else
p1_6 = 0;
if (c & 0b00100000)
p1_5 = 1;
else
p1_5 = 0;
if (c & 0b00010000)
p1_4 = 1;
else
p1_4 = 0;
if (c & 0b00100000)
p1_5 = 1;
else
p1_5 = 0;
if (c & 0b00010000)
p1_4 = 1;
else
p1_4 = 0;
p1_2 = 0;
}
p1_2 = 0;
}
void lcd_8b (unsigned char car)
{
lcd_4b(c);
lcd_4b(c<<4);
}
void lcd_8b (unsigned char car)
{
lcd_4b(c);
lcd_4b(c<<4);
}
void lcd_com(unsigned char com)
{
p1_0 = 0;
lcd_8b(com);
void lcd_com(unsigned char com)
{
p1_0 = 0;
lcd_8b(com);
}
}
}
}

Formats disponibles : Unified diff