Pages: [1]   Go Down
Author Topic: LCD - CustomCharacter:117: error: call of overloaded 'write(int)' is ambiguous  (Read 6853 times)
0 Members and 1 Guest are viewing this topic.
uk
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

uk
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

Thanks thats sorted it!!

Scott   smiley-grin smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the help as well.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Western New York, USA
Online Online
Faraday Member
**
Karma: 41
Posts: 4435
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
lcd.write(8);
 

Don
Logged

Pages: [1]   Go Up
Jump to: