Go Down

Topic: LCD - CustomCharacter:117: error: call of overloaded 'write(int)' is ambiguous (Read 7663 times) previous topic - next topic

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.

dxw00d

Change
Code: [Select]
  lcd.write(0);
to
Code: [Select]
  lcd.write((byte)0);
on line 115ish.



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

shimoda

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.

floresta

Quote
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 (http://forum.arduino.cc/index.php?topic=174883.msg1298248#msg1298248) and I explain how you could have used:
Code: [Select]
lcd.write(8);  

Don

Go Up