Create custom charactors on LCD Shield Kit w/ 16x2 Character Display

by Le-bo2d9 on Sat Dec 01, 2012 2:43 am

Hi,

I bought the LCD Shield Kit w/ 16x2 Character Display shield.
Is it possible to display custom characters on the display?

Kind regards

Koen
Le-bo2d9
 
Posts: 2
Joined: Sat Dec 01, 2012 2:31 am

Re: Create custom charactors on LCD Shield Kit w/ 16x2 Character Display

by Le-bo2d9 on Sat Dec 01, 2012 8:19 am

Hi,

I have found the solution.

Below you can find a small example

Code: Select all
#include <Wire.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>

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

Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

// Pin definitions
const byte
  RTC_GND_PIN = A2,  //I use A2 for GND and A3 for VCC to power the I2C equipment
  RTC_VCC_PIN = A3;
 
 
 void setup(){
  pinMode(RTC_GND_PIN, OUTPUT);
  pinMode(RTC_VCC_PIN, OUTPUT);
  digitalWrite(RTC_GND_PIN,LOW);
  digitalWrite(RTC_VCC_PIN,HIGH);
   lcd.createChar(0, smiley);
  lcd.begin(16, 2); 
  lcd.write(0);
 }
 
void loop() {}


Kind regards

Koen
Le-bo2d9
 
Posts: 2
Joined: Sat Dec 01, 2012 2:31 am

Re: Create custom charactors on LCD Shield Kit w/ 16x2 Chara

by MechaTweak on Sat Mar 29, 2014 2:11 pm

I know this is an old post, but the reply for Le-bo2d9 did not work for me. Instead of a smiley I got pixel garbage.

After a little experimentation I found that the problem goes away if you put lcd.begin above lcd.createChar.

I did not have to call any pinMode or digitalWrite functions and did not have to setup any pin definitions.

This seems like an easier fix, so I thought I would post...
MechaTweak
 
Posts: 1
Joined: Tue Dec 10, 2013 4:49 pm