Web4Robot Serial LCD Controller not compiling

Hey all, I've been fighting with this dang thing for a while now. I've been on Google and tried every possible combination of keywords/errors etc to no avail. I know I can't be the only person who has had this problem, but I can not find the solution. So, here goes.

I got the Web4Robot serial controller today (http://www.web4robot.com/LCDCtrl.html), soldered my pins and now it's connected to my LCD (20x4 from Hacktronics/Amazon) I downloaded the library files from Web4Robot which is the LCD12C v0.4. I've "installed" the library and open Arduino (v1.0) and load the "Hello_World" example that is included with the library. I click on compile and get an error:

In file included from Hello_World.cpp:4:
D:\Ray\My Documents\arduino-1.0-windows\arduino-1.0\libraries\LCDI2C/LCDI2C.h:37: error: conflicting return type specified for 'virtual void LCDI2C::write(uint8_t)'
D:\Ray\My Documents\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

As I said, I can't find a solution to this, I've looked the reference lines but I'm too new to Arduino to understand what to do.

TYIA for your help,

Ray

Oh, forgot to mention, I've also tried the LCDAPI 1.0 in the playground which is LCDi2cW which is still a no go.

I've been on Google and tried every possible combination of keywords/errors etc to no avail. I know I can't be the only person who has had this problem, but I can not find the solution.

Well, google is pretty smart. But the search field on the forum limits the search to just the Arduino site. This EXACT same error message has been posted before. And an explanation of the error, and a solution, was given.

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

Ray, don't let PaulS get you down with his non-helpful reply which does not solve your problem. You need to change the return type inside of LCDI2C.h (and LCDI2C.cpp) from void to size_t for the write function.

rayman0487:
Hey all, I've been fighting with this dang thing for a while now. I've been on Google and tried every possible combination of keywords/errors etc to no avail. I know I can't be the only person who has had this problem, but I can not find the solution. So, here goes.

I got the Web4Robot serial controller today (http://www.web4robot.com/LCDCtrl.html), soldered my pins and now it's connected to my LCD (20x4 from Hacktronics/Amazon) I downloaded the library files from Web4Robot which is the LCD12C v0.4. I've "installed" the library and open Arduino (v1.0) and load the "Hello_World" example that is included with the library. I click on compile and get an error:

In file included from Hello_World.cpp:4:

D:\Ray\My Documents\arduino-1.0-windows\arduino-1.0\libraries\LCDI2C/LCDI2C.h:37: error: conflicting return type specified for 'virtual void LCDI2C::write(uint8_t)'
D:\Ray\My Documents\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'




As I said, I can't find a solution to this, I've looked the reference lines but I'm too new to Arduino to understand what to do.

TYIA for your help,

Ray

You need to change the return type inside of LCDI2C.h (and LCDI2C.cpp) from void to size_t for the write function.

Which is exactly what the thread I linked to gets around to saying.

cvmaas, Thanks for your reply. I was reading referenced post and was wondering how that was related, it was a very similar (not exactly) same issue. I'm not sure how changing " "#include <NewSoftSerial.h>" to "#include <SoftwareSerial.h>"" would help me, since I'm not using that library and I'm using the LCD12C as my original post stated. Also, not sure if I missed it or what, but I can't find the part in that post where it "gets around to saying" to change the return type. All that post says is to drop the New from the library include statement and change from WProgram.h to Arduino.h (which applies to everything in 1.0) As said, new to Arduino, not the Internet.

Moving on, cvmaas, I'm tried to comprehend what you are saying, but still get it to compile. When I try virtual size_t write(uint8_t); and size_t LCDI2C::write(uint8_t value) which doesn't make sense, but uses your suggestions literally, upon compile I get an error for just about every line in .cpp

Trying virtual void write(size_t); and void LCDI2C::write(size_t value) which makes some sense to me, I get

Hello_World.pde:-1: error: cannot allocate an object of abstract type 'LCDI2C'
~\libraries\LCDI2C/LCDI2C.h:25: note:   because the following virtual functions are pure within 'LCDI2C':
~\arduino\cores\arduino/Print.h:48: note: 	virtual size_t Print::write(uint8_t)
Hello_World.pde:-1: error: cannot declare variable 'lcd' to be of abstract type 'LCDI2C'
~\libraries\LCDI2C/LCDI2C.h:25: note:   since type 'LCDI2C' has pure virtual functions

Really hoping to get this working tomorrow, anyone else have any ideas? Surely somene has to be using this controller.

Your Web4Robot files are probably pre-IDE1.0 so, you have to use a fix.

I also noticed on the Arduino site that if you are using the V1.0 IDE and you have a reference to

#include <WProgram.h>

in any of your library .h or .cpp files, these references must be changed to

#include <Arduino.h>.

This library did not contain <WProgram.h> which must be changed for all libraries in 1.0.

Anyhow, cvmaas's post was the most helpful in getting me to where I needed to be. I'm posting this response for the next person that is having issues with this controller.

To use this controller with Arduino 1.0:
First backup LCDI2C.h & .cpp - obviously.

Second, edit LCDI2C.h, change line 37 virtual void write(uint8_t); to   virtual size_t write(uint8_t); This is what cvmaas said to do, but I didn't realize that's not the only issues with this library.

Third, edit LCDI2C.cpp: change #include "WConstants.h" to #include "Arduino.h"
Line 95 from void LCDI2C::write(uint8_t value) { to size_t LCDI2C::write(uint8_t value) {
Then use find/replace and replace every instance of Wire.send to Wire.write
and Wire.receive with Wire.read

Only issues now relate to the graphing functions, which I don't have plans to use, so I commented out the 3 graphing functions as I did not want to investigate the compile errors. I've included my .h and .cpp files for anyone that wishes to just download those instead of making the changes themselves.

LCDI2C.cpp (4.09 KB)

LCDI2C.h (1.78 KB)

Hello, I am having the same problem. I simply replaced my LCDI2C.h and LCDI2C.cpp files with the ones rayman attached and now I get the errors:

LCDI2C\LCDI2C.cpp.o: In function LCDI2C::home()': C:\Users\Justin\Desktop\arduino-1.0\libraries\LCDI2C/LCDI2C.cpp:124: undefined reference to LCDI2C::setCursor(int, int)'

Is there something else I'm missing? Thank you

What code are you working with? I have further edited my library files, but after downloading the files I have previously uploaded, I get the same error when trying to compile some of the examples. I have written my own programs and have not had any issues with the error you are receiving.

Let me know what code you are working with and we can go from there.

hey rayman, im simply trying to run the helloworld example. i have a program in the works thats runs great without the ic2 controller. i figure if i can just get it to compile and print something with hello world, then ill be able to load the new statements for the ic2 to work in my main program. im also worried about this library as i want to use a keyboard through the i2c controller. i appreciate your help.

Hmm... I don't recall having this issue when I uploaded the library files, but now I am getting the same error when I try to use them. I just edited the .cpp file and commented out 2 lines. Comment out or delete the setCursor(0,0); line under home (line 120ish) and then comment out or delete the line home(); within the init function (this is one of the last lines) That should make the code compile. This works well enough for me, after all I find just as easy to code lcd.setCursor(0,0); as opposed to calling lcd.home(); making the home function completely unnecessary, IMO.

You said you are planning to use a keypad with your program, if you want to take a look at my current library files, PM me and I'll send them to you. I've added extra functions for easy key reading and reading and setting the brightness and contrast among a few other tweaks.

I found the same problems when trying to use my Web4Robot LCDI2C device. The library worked fine under Arduino 22, but creates the errors mentioned under 1.0.1. I also noticed that the library posted on the Web4Robot web page, LCDI2Cw.h, references new features in the later version of the I2C backpack module, such as the IR detector with NEC 38KHz protocol. I think it is likely the module firmware has been updated and there may be incompatibilities between the new library and the older modules.

Rayman....Use arduino 0022 or 0023 for that library. I have the same LCD/Keypad backpack and I have no known issues using the 0023 version. When I use the 1.0 I get a lot of compiling errors with various libraries I use. If anything try using this library:

http://www.reefprojects.com/LCDI2C-v0.4.zip