/*********************
* PANTALLA LCD A 4 BITS
*/
byte cuenta = 0;
// B7 B6 B5 B4 COMUNES
byte pines[]={23, 22, 4, 3, 18, 15};
// 0 1 0 0 (ver notas en Mensaje)
#define EN 18
#define RS 5
void setup()
{
for (byte i = 0; i < 6; i++)
{
pinMode(pines[i], OUTPUT);
}
digitalWrite(EN, LOW);
configuracion( );
limpiar();
cursor(0, 4); // Renglon 0, Caracter 3
Mensaje("Hola Mundo");
cursor(1,5);
Mensaje("Alexis");
}
void loop()
{
switch (cuenta)
{
case 0:
cursor(0, 4); // Renglon 0, Caracter 3
Mensaje("Hola Mundo");
cursor(1,5);
Mensaje("Alexis");
break;
case 30:
cursor(0, 4); // Renglon 0, Caracter 3
Mensaje("Cuento solo");
cursor(1,5);
Mensaje("Wow");
break;
case 90:
cursor(0, 4); // Renglon 0, Caracter 3
Mensaje("Ya termine");
cursor(1,5);
Mensaje("Va de nuez");
break;
}
cursor(1,12);
Mensaje(String (cuenta));
delay(300);
cuenta++;
if (cuenta > 100)
cuenta = 0;
}