Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Navid T said:hello
whats init code for "1 X 16" LCD?
thank you
Navid
//fonction d'initialisation de l'écran
void initlcd (void)
{
LCDdata = 0b00000000; //toutes les pins de données à 0
LCDrw = 0;
LCDenable = 0; //enable à 0
LCDrs = 0; //Register Select à 0 (configuration)
longwait;
//display ON
LCDdata = 0b00001111;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
// mode 8 bit
LCDdata = 0b00000001;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
// effacer l'écran
LCDdata = 0b00111000;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
//fonction pour choisir entre quelle ligne d'écran
void line (int x)
{
if (x == 1)
{
//set display adress au début de l'écran (ligne 1)
LCDrs = 0;
LCDrw = 0;
LCDdata = 0x80;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
if (x == 2)
{
//set display adress au 9e charactère (ligne 2)
LCDrs = 0;
LCDrw = 0;
LCDdata = 0xC0;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
}
//configuration de l'écran (efface, home, etc)
void configuration (int config)
{
if (config == 1)
{
//efface l'écran
LCDrs = 0;
LCDdata = 0b00000001;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
if (config == 2)
{
//curseur et écran home
LCDrs = 0;
LCDdata = 0b00000011;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
if (config == 3)
{
//curseur ON
LCDrs = 0;
LCDdata = 0b00001111;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
if (config == 4)
{
//curseur OFF
LCDrs = 0;
LCDdata = 0b00001100;
wait;
LCDenable = 1;
wait;
LCDenable = 0;
wait;
}
}[quote]
Hope this help!
JFDuval