LiquidCrystal_I2C on Codebender

Hello! I'm working on a project with an I2C LCD display using the LiquidCrystal_I2C library. It works fine using the standard Arduino IDE, but when the same code is pasted into codebender, I get the following error:

Untitled_Project.ino:28:53: error: use of undeclared identifier 'POSITIVE'
LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

Most examples use a deceleration like LiquidCrystal_I2C lcd(0x20,16,2);

to declare the size of the display. For some reason the preceding format only seems to work with my I2C adapter. Is this a problem with codebender, or the library?

Those two constructors are for two different libraries.

I don't know anything about codebender or how it works, but
you must use the proper constructor for the library you are using.

--- bill

Hi there!

I am Fotis from the codebender team. The LiquidCrystal_I2C library hosted by codebender is this one http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/. The library you are trying to use seems to be this one http://www.argeduino.com.ar/download/LiquidCrystal/, which includes LiquidCrystal_I2C.
By default, the first one is used when you "#include <LiquidCrystal_I2C.h>".
However, you can add the second library to your account as a personal one, which should make your project compile successfully.
See this article for more info http://codebender.uservoice.com/knowledgebase/articles/399209-personal-libraries. :wink:

Regards,
Fotis

Codebender Team