Projet

Général

Profil

« Précédent | Suivant » 

Révision 612

Ajouté par megoutteno il y a presque 4 ans

Réalisation de la fonction lcd_4b

Voir les différences:

branch/Gouttenoire/sp4b2/SP4b2/SP4b2/SP4b2.c
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/***********************************************************************/
#include "sfr32c87.h"
void lcd_4b(unsigned char car);
void main(void)
{
/* pd1=0xff; // definit en sortie
p1_2=1; //E=1
p1_7=1; */
lcd_4b(0x80);
}
void lcd_4b(unsigned char car)
{
pd1=0xff; // definit en sortie
p1_2=1; //E=1
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;
}
}
}

Formats disponibles : Unified diff