Reference.LiquidCrystalCreateChar History

Show minor edits - Show changes to markup

March 06, 2013, at 10:29 AM by Scott Fitzgerald -
Changed lines 9-11 from:

''NB : When referencing custom character "0", if it is not in a variable, you need to cast it as a byte. See the example below.''

to:

NB : When referencing custom character "0", if it is not in a variable, you need to cast it as a byte, otherwise the compiler throws an error. See the example below.

March 06, 2013, at 10:29 AM by Scott Fitzgerald -
Added lines 9-11:

''NB : When referencing custom character "0", if it is not in a variable, you need to cast it as a byte. See the example below.''

Changed line 45 from:
  lcd.write(0);
to:
  lcd.write(byte(0));
July 27, 2009, at 11:18 PM by David A. Mellis -
Changed lines 7-8 from:

Create a custom character (gylph) for use on the LCD. Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, write?() its number.

to:

Create a custom character (gylph) for use on the LCD. Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, write() its number.

July 27, 2009, at 11:17 PM by David A. Mellis -
Changed lines 7-8 from:

Create a custom character (gylph) for use on the LCD. Up to eight characters of 5x8 pixels are supported. The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row.

to:

Create a custom character (gylph) for use on the LCD. Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, write?() its number.

July 27, 2009, at 11:16 PM by David A. Mellis -
Added lines 1-47:

LiquidCrystal

createChar()

Description

Create a custom character (gylph) for use on the LCD. Up to eight characters of 5x8 pixels are supported. The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row.

Syntax

lcd.createChar(num, data)

Parameters

lcd: a variable of type LiquidCrystal

num: which character to create (0 to 7)

data: the character's pixel data

Example


#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

byte smiley[8] = {
  B00000,
  B10001,
  B00000,
  B00000,
  B10001,
  B01110,
  B00000,
};

void setup() {
  lcd.createChar(0, smiley);
  lcd.begin(16, 2);  
  lcd.write(0);
}

void loop() {}


Share