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

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lebo2d9
 
Posts: 2
Joined: Sat Dec 01, 2012 3:31 am

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

Post by lebo2d9 »

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

User avatar
lebo2d9
 
Posts: 2
Joined: Sat Dec 01, 2012 3:31 am

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

Post by lebo2d9 »

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

User avatar
mechatweak
 
Posts: 1
Joined: Tue Dec 10, 2013 5:49 pm

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

Post by mechatweak »

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...

norva
 
Posts: 21
Joined: Tue May 16, 2017 5:10 am

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

Post by norva »

Thanks a lot, this saved me :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”