Hola. Estoy buscando una solucion para el siguiente problema. Tengo una pantalla lcd 16x2 (CON ADAPTADOR) conectada por I2C a un Arduino Uno R3. Todas las conexiones están bien hechas y el código no da ningún error al compilarlo. De hecho todo funciona excepto que a la hora de imprimir por pantalla solo imprime algunas instrucciones y otras no. A continuación pongo el código y comento las instrucciones que no se imprimen con el comentario " //NO IMPRIME POR PANTALLA "
//LCD config
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); //sometimes the LCD adress is not 0x3f. Change to 0x27 if it dosn't work.
int i = 0;
uint8_t bell[8] = {0x4, 0xe, 0xe, 0xe, 0x1f, 0x0, 0x4};
uint8_t note[8] = {0x2, 0x3, 0x2, 0xe, 0x1e, 0xc, 0x0};
uint8_t Clock[8] = {0x0, 0xe, 0x15, 0x17, 0x11, 0xe, 0x0};
uint8_t heart[8] = {0x0, 0xa, 0x1f, 0x1f, 0xe, 0x4, 0x0};
uint8_t duck[8] = {0x0, 0xc, 0x1d, 0xf, 0xf, 0x6, 0x0};
uint8_t check[8] = {0x0, 0x1 ,0x3, 0x16, 0x1c, 0x8, 0x0};
uint8_t cross[8] = {0x0, 0x1b, 0xe, 0x4, 0xe, 0x1b, 0x0};
uint8_t retarrow[8] = { 0x1, 0x1, 0x5, 0x9, 0x1f, 0x8, 0x4};
void setup() {
lcd.init(); //Init the LCD
lcd.backlight(); //Activate backlight
lcd.createChar(0, bell);
lcd.createChar(1, note);
lcd.createChar(2, Clock);
lcd.createChar(3, heart);
lcd.createChar(4, duck);
lcd.createChar(5, check);
lcd.createChar(6, cross);
lcd.createChar(7, retarrow);
lcd.home();
}
void loop() {
// Turn off the display:
lcd.clear();
lcd.print(" ELECTRONOOBS "); //NO IMPRIME POR PANTALLA
lcd.clear();
lcd.setCursor(0,0);
lcd.write(1);
lcd.write(2);
lcd.write(3);
lcd.write(4);
lcd.write(5);
lcd.write(6);
lcd.write(7);
delay(3000);
lcd.noDisplay();
delay(500);
// Turn on the display:
lcd.display();
delay(500);
lcd.noDisplay();
delay(500);
// Turn on the display:
lcd.display();
delay(500);
lcd.clear();
while(i<16)
{
lcd.setCursor(i,0);
lcd.print("X");
i = i + 1;
delay(100);
}
i = 0;
while(i<16)
{
lcd.setCursor(i,1);
lcd.print("X");
i = i + 1;
delay(100);
}
i = 0;
lcd.setCursor(0,0);
lcd.print(" 1234567890 "); //NO IMPRIME POR PANTALLA
lcd.setCursor(0,1);
lcd.print(" 0987654321 "); //NO IMPRIME POR PANTALLA
delay(2000);
lcd.setCursor(0,0);
lcd.print(" !$%&/()=?! "); //NO IMPRIME POR PANTALLA
lcd.setCursor(0,1);
lcd.print(" |@#~!$%&/% "); //NO IMPRIME POR PANTALLA
delay(2000);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" This is LCD 2 "); //NO IMPRIME POR PANTALLA
delay(3000);
}