LCD - CustomCharacter:117: error: call of overloaded 'write(int)' is ambiguous

Hi

I have been using the LCD examples that came with the IDE, I have had no problems with the Hello World one and scrolling text one, But the Custom Character one when I run it comes up with the following error:

CustomCharacter.cpp: In function 'void setup()':
CustomCharacter:114: error: call of overloaded 'write(int)' is ambiguous
C:\Users\Scott\Documents\Arduino\arduino-1.0.1-windows\arduino-1.0.1\libraries\LiquidCrystal/LiquidCrystal.h:82: note: candidates are: virtual size_t LiquidCrystal::write(uint8_t)
C:\Users\Scott\Documents\Arduino\arduino-1.0.1-windows\arduino-1.0.1\hardware\arduino\cores\arduino/Print.h:49: note: size_t Print::write(const char*)

Being new to the programming side I am at a loss as to how to fix this error.

Any Help on this matter would be appriciated!!

Thanks

Scott.

Change

  lcd.write(0);

to

  lcd.write((byte)0);

on line 115ish.

1 Like

Hi

Thanks thats sorted it!!

Scott :smiley: :smiley:

Thanks for the help as well.

why did u use the ""lcd.write((byte)0);""" instead of "lcd.write(0);" ??? 1 thing i know that if we use lcd.write(0); then complier will show "call of overloaded 'write(int) is ambiguous." why we use the byte in lcd.write() function.???

I'm assuming that the custom characters were typed as byte, and thus the change in declaration, new to this so perhaps someone else could chime in.

why did u use the ""lcd.write((byte)0);""" instead of "lcd.write(0);"

It's because of how the Arduino IDE deals with 'writing'. The complete explanation can be found here: http://forum.arduino.cc/index.php?topic=174883.msg1299547#msg1299547.

Scroll up a few posts (Caracteres Speacial - #2 by floresta - Displays - Arduino Forum) and I explain how you could have used: lcd.write(8);

Don