praticamente con quella libreria la compila e carica direttamente ma non si vede nulla sul display, o meglio.. a volte si vede una sola riga di quadratini neri, a volte una qadratino lampeggiante che gira per lo schermo e dopo un pò svanisce.. tutti errori di visualizzazione un pò casuali, mai che vedo caratteri.
EDIT:
Sono riuscito a farlo funzionare tutto stava nel dichiarare
LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// create an lcd instance with correct constructor for how the lcd is wired to the I2C chip
LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); // addr, EN, RW, RS, D4, D5, D6, D7, Backlight, POLARITY
// Creat a set of new characters
const uint8_t charBitmap[][8] = {
{ 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
{ 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
{ 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
{ 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
{ 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
{ 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
{ 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
{ 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }
};
void setup()
{
int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));
lcd.begin(16,2); // initialize the lcd as 20x4 (16,2 for 16x2)
lcd.setBacklight(1); // switch on the backlight
for ( int i = 0; i < charBitmapSize; i++ )
{
lcd.createChar ( i, (uint8_t *)charBitmap[i] );
}
lcd.home (); // go home to character 0 on line 0 (1st line)
lcd.print("Hello, ARDUINO ");
lcd.setCursor(0,1); // character 0 on line 1 (2nd line)
lcd.print (" FORUM - fm ");
delay(1000);
}
void loop()
{
lcd.clear();
lcd.home ();
// Do a little animation by writing to the same location
for ( int i = 0; i < 2; i++ )
{
for ( int j = 0; j < 16; j++ )
{
lcd.print (char(random(7)));
}
lcd.setCursor ( 0, 1 );
}
delay (200);
}
Grazie a tutti di tutto!