Hi everyone,
I just bought a new LCD for my Arduino and after figuring out how to make it work using the LiquidCrystal_I2C library, it works. Only I can't manage to display custom characters on it.
Now I have no idea if it's specific to that library or if I would have had that problem anyway because this is the first time ever I try to do this.
I made a hyper simple code to display my custom characters and it gives me the same issue. Here it is :
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// LCD
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
Serial.begin(9600); // COMMENT OUT IF USING PIN 1
// Characters
byte whole[8] = {B00000, B00000, B00000, B00000, B00000, B01110, B10001, B01110};
byte half[8] = {B00001, B00001, B00001, B00001, B00001, B01111, B10001, B01110};
byte quarter[8] = {B00001, B00001, B00001, B00001, B00001, B01111, B11111, B01110};
byte eighth[8] = { B01110, B01001, B00101, B00010, B00001, B01111, B11111, B01110};
byte sixteenth[8] = {B00110, B00101, B00110, B00101, B00100, B01100, B11100, B01000};
byte sixteenthRest[8] = {B00000, B01001, B10101, B01010, B00100, B01000, B10000, B00000};
lcd.createChar(0, whole);
lcd.createChar(1, half);
lcd.createChar(2, quarter);
lcd.createChar(3, eighth);
lcd.createChar(4, sixteenth);
lcd.createChar(5, sixteenthRest);
// LCD
lcd.begin(16, 2); // set up the LCD's number of columns and rows
}
void loop() {
lcd.write(byte(0));
delay(2000);
lcd.write(byte(1));
delay(2000);
lcd.write(byte(2));
delay(2000);
lcd.write(byte(3));
delay(2000);
lcd.write(byte(4));
delay(2000);
lcd.write(byte(5));
delay(2000);
}
Any idea why it displays wrong characters instead of the ones I made ?
Thanks a lot,
Antoine