Arduino Forum

Community => Website and Forum => Topic started by: hellonearthis on Mar 04, 2012, 02:53 am

Title: createChar() tutorial no longer works due to lcd.write
Post by: hellonearthis on Mar 04, 2012, 02:53 am
Just been working with custom LCD characters and found that the createChar() tutorial is out of date with version 1.0 of the IDE.
http://arduino.cc/en/Reference/LiquidCrystalCreateChar

The LCD.write(0); no longer works and can be replaced with LCD.print((char)0);

Working example:
Code: [Select]
#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); no longer works
  lcd.print((char)0);
}

void loop() {}
Title: Re: createChar() tutorial no longer works due to lcd.write
Post by: gcm2 on Mar 08, 2012, 03:31 pm
Thank you mucho! - I just ran into this last night for the first time, and gave up trying to use write(0) since it would not compile. print((char),0) works, and the rest of my "normal" write(x)'s are fine.
Title: Re: createChar() tutorial no longer works due to lcd.write
Post by: gcm2 on Mar 08, 2012, 03:51 pm
After a little more searching, I found this:

http://arduino.cc/forum/index.php/topic,74666.0.html

lcd.write((uint8_t)0);

works also!
Title: Re: createChar() tutorial no longer works due to lcd.write
Post by: hellonearthis on Mar 08, 2012, 04:15 pm
Thanks for that write example.
Title: Re: createChar() tutorial no longer works due to lcd.write
Post by: DWRIGHT02 on Apr 10, 2012, 06:51 am
thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you



i spent a long time trying to solve this issue. thank you!!!!
Title: Re: createChar() tutorial no longer works due to lcd.write
Post by: amalulla on Apr 02, 2014, 10:43 am
Thanks a lot! It was so useful!