GPS/GPRS/GSM Shield V3.0 (Arduino Compatible) can“t make it work! by N4rf
[Today at 01:53:11 am]


DFduino Player Module - HELP by agwhiteb0i
[June 18, 2013, 09:20:25 pm]


ecoduino xbee by Phoebe
[June 18, 2013, 10:29:23 am]


[SOLVED] Bluetooth Bee V2 + Arduino Uno R3 + Xbee Shield: AT mode? by luke_bonham
[June 17, 2013, 11:39:13 pm]


URM04 V2.0 How to assign a different ID by Jose
[June 17, 2013, 04:23:34 pm]


romeo v2 and mitsumi m42sp-4n by infobarque
[June 17, 2013, 03:57:26 pm]


XBoard V2.0 Ethernet + XBEE by Jose
[June 17, 2013, 12:46:33 pm]


How about an actual working library for the V2 board? by Jose
[June 17, 2013, 12:44:19 pm]


DFRobot Fritzing Library by Jose
[June 17, 2013, 12:40:03 pm]

Sorry, this shoutbox does not exist.

Author Topic: I2C-LCD dosn't work (software / compiler - problem)  (Read 3785 times)

df0021

  • Jr. Member
  • **
  • Posts: 14
  • Karma: +0/-0
I2C-LCD dosn't work (software / compiler - problem)
« on: April 28, 2012, 07:26:00 am »
Hello,
my first beginning with Arduino (Itearduino) was the not succesfull.
Board and I2C-LCD are connected, I did try the sketch Hello, world. The backgrundlight is on - but the compiler shows a failure message:

c:\Progr-MCU\Arduino\arduino-1.0\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:81: error: conflicting return type specified for 'virtual void LiquidCrystal_I2C::write(uint8_t)'
c:\Progr-MCU\Arduino\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

After using the newest Arduino-IDE did I try an older version (...0022), but it was not better.

What can I do?

Regards
df0021


zerblatt007

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #1 on: May 02, 2012, 01:22:27 am »
There is a problem in LiquidCrystal_I2C.h and LiquidCrystal_I2C.cpp because it was written for pre 1.0 Arduino:
http://stackoverflow.com/questions/8749232/trouble-converting-an-arduino-library-from-arduino-0023-to-1-0

LiquidCrystal_I2C.h:
change line in these files from
virtual void write(uint8_t);
to
virtual size_t write(uint8_t);

LiquidCrystal_I2C.cpp:
change line in these files from
inline void LiquidCrystal_I2C::write(uint8_t value) {
to
inline size_t LiquidCrystal_I2C::write(uint8_t value) {

Hopefully this will be fixed in the future, but for now you have to change this yourself..

df0021

  • Jr. Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #2 on: May 02, 2012, 08:16:19 am »
Hello Zerblatt007

thank you for your answer.
I did change it like you write, but now is there an other failure message.


HelloWorld.pde:-1: error: cannot declare variable 'lcd' to be of abstract type 'LiquidCrystal_I2C'
C:\Progr-MCU\Arduino\arduino-1.0\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:59: note:   because the following virtual functions are pure within 'LiquidCrystal_I2C':
C:\Progr-MCU\Arduino\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: note:    virtual size_t Print::write(uint8_t)

In print.h : 48 is to read:
   virtual size_t write(uint8_t) = 0;                // virtual size_t write(uint8_t) = 0;

regards
df0021

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +22/-2
    • Follow us on Twitter for coupons and product updates!
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #3 on: May 02, 2012, 12:25:08 pm »
Hi,


When you try Arduino IDE 0022, what is the problem?
-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

df0021

  • Jr. Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #4 on: May 02, 2012, 09:23:27 pm »
Hi Hector

I did just use Ardino0022 (after transfering the right Headerfile in the right path),
but I get a failure message:


HelloWorld:4: error: cannot declare variable 'lcd' to be of abstract type 'LiquidCrystal_I2C'
C:\Progr-MCU\Arduino-0022\arduino-0022\libraries\LiquidCrystal_I2C_vArd10/LiquidCrystal_I2C.h:59: note:   because the following virtual functions are pure within 'LiquidCrystal_I2C':
C:\Progr-MCU\Arduino-0022\arduino-0022\hardware\arduino\cores\arduino/Print.h:40: note:    virtual void Print::write(uint8_t)

My knowledge of Ardino-programming is unfortunable to small, so I'm not able to correct the failure and therefore I do need help.

regards
df0021

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +22/-2
    • Follow us on Twitter for coupons and product updates!
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #5 on: May 03, 2012, 04:45:01 pm »
Hi,


I have not seen this error, and I can not replicate it here. Please make sure you have all of the files for the library in the correct directory, and close then re-open the Arduino IDE.
-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

df0021

  • Jr. Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #6 on: May 03, 2012, 08:23:00 pm »
Hi Hector

I know, it is a little bit tricky to find out the right place of the headerfiles. I checked it again and again and did it compare with the other files included in the system.
I placed it in ardino0022/libraries at the same place, where the "normal" directories are.
I did compare the structure of the old and my new directories - it was no difference.
I did change the names of the directories and checked in the arduino-ide what happened - the ide did show the changed names at the right place.
At least did I change in the file, named by the error message, e.g. uint8_t in uint13_t, in order to check if is the right file. The error messages did show the new errors.

I'm sure (relatively) ardino has the right files to work with. I repaet the failure message and you can see, that the right file is named:
HelloWorld:4: error: cannot declare variable 'lcd' to be of abstract type 'LiquidCrystal_I2C'
C:\Progr-MCU\Arduino-0022\arduino-0022\libraries\LiquidCrystal_I2C_vArd10/LiquidCrystal_I2C.h:59: note:   because the following virtual functions are pure within 'LiquidCrystal_I2C':
C:\Progr-MCU\Arduino-0022\arduino-0022\hardware\arduino\cores\arduino/Print.h:40: note:    virtual void Print::write(uint8_t)

I'm afraid, there is an other problem.
But it seems to be not to big (so I hope). The ide shows in the sketch only one line marked:
LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

and below it is to read:
cannot declare variale 'lcd' to be of abstract type 'LiquidCrystal_I2C'.

I hope the information is enough so you can find out the raison of my problem.

regards
df0021


Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +22/-2
    • Follow us on Twitter for coupons and product updates!
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #7 on: May 04, 2012, 05:32:40 pm »
Ok,


I would recommend you delete the library all together from both the IDE0022 and V1.


Then download it again from the Wiki


and place it in: Arduino-0022\libraries\ .Do not modify the folder name.


You can also place it in the Arduino-1.0\libraries\ folder.


If you placed them in the correct spot, you should be able to open the Arduino IDE and check in the Examples menu and find the LiquidCrystal I2C sub menu and choose any of the sample codes from there. It should compile for you.


Please keep in mind that the Arduino IDE should be closed completely when removing and replacing libraries. If it was not closed, then just close the IDE and re-open it, the changes should now take effect.



-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

df0021

  • Jr. Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #8 on: May 05, 2012, 05:08:01 am »
Hi, Hector

it works!
I did delete the whole Ardiuno-0022 and Arduino1.0, then did I download arduino-0022 again and the library from Wiki - and there where no problems concerning compiling, uplaoding and function at the iteardino!
Did you write the LiquidCrystal_I2C-1 new and especially for my little Arduino?
I did intend to use the Arduino for a urgent and quick project without to much programming and tinking. Now I can start!

Works your new LiquidCrystal_I2C-1 only in Arduino-0022? What is, when I my Arduino update to the version 1.0 (is it necessary?).

I thank you very much for your kindly help!
df0021
« Last Edit: May 05, 2012, 05:12:27 am by df0021 »

Hector

  • Not an
  • Hero Member
  • *****
  • Posts: 788
  • Karma: +22/-2
    • Follow us on Twitter for coupons and product updates!
Re: I2C-LCD dosn't work (software / compiler - problem)
« Reply #9 on: May 07, 2012, 10:29:40 am »
Hi


I'm glad you got it working! I did not write it, we have updated it to be compatible with IDE 1.0 You should be able to get it working with 1.0 as well, just repeat the process for IDE 1.0


I don't think its necessary to update. We still use 0022 for many projects. Its really a matter of preference.

-Hector

Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

 

SimplePortal 2.3.4 RC1 © 2008-2011, SimplePortal