Issue #41 new

createChar not resettable

Anonymous created an issue

Hi, ive read about issue #8 https://bitbucket.org/fmalpartida/new-liquidcrystal/issue/8/bug-with-createchar

My problem is, that i cant redefine the custom characters. Lets say I have defined 8 characters and want to replace them, because i need more (eg as new alphabet). Its not working. If i do this the Display wont show anything else. Thats too bad :(

It would be great if you could add this feature, correct this bug (like in the default library) so you can use more than 8 custom chars.

My code:

// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home#!usage

//LCD I2C Display
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x27
#define BACKLIGHT_PIN 3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin, BACKLIGHT_PIN,POSITIVE);

byte mychar[8] = //icon
{
  B00000,
  B00000,
  B11111,
  B00101,
  B10101,
  B00100,
  B11111,
  B00000
};
byte mychar2[8] = //icon2
{
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
};

void setup()
{
  lcd.begin(16,2);
  lcd.createChar(0, mychar);
  lcd.createChar(1, mychar2);

  lcd.home(); 
  lcd.write("Test");
  lcd.write(byte(0));
  lcd.write(byte(1)); //outputs everything okay "Testxx" x=symbols
  delay(2000);

  lcd.clear(); //clears
  lcd.createChar(1, mychar); //no output at all from now
  lcd.write("Test"); //nothing
  lcd.write(byte(1));  //nothing
}

void loop()
{
  //lcd.setCursor (0,1);        // go to start of 2nd line
  //lcd.print(millis()/1000);
}

Comments (0)

  1. Log in to comment