Problem with LiquidCrystal_I2C library and Arduino 1.0 [SOLVED]

With recent changes made to Arduino IDE, this library is no longer working.
Anyone has an updated version or can we try and make it work?

I include a copy attached here.

Thanks for any feedback

LiquidCrystal_I2C.rar (14.5 KB)

Welcome to the wonderful world of Arduino 1.0
100% of the pre 1.0 libraries break and won't compile with the 1.0 release.
Better get used to it.
I attached an updated library for you.
The changes are minimal to make it work for pre 1.0 and 1.0
but this is an example of how Arduino 1.0 breaks all the existing pre 1.0 libraries.
Study it for how to correct issues that will come up on other libraries
as this will be a very common problem when using 1.0

The other alternative is to simply not upgrade to 1.0
There are very few new capabilities in 1.0 and for the most part
it simply creates lots of headaches, at least for now.
If what you had was working, there is no driving need to upgrade to 1.0
With 1.0 your code size will get larger and the available RAM for your sketch is reduced
as the Arduino 1.0 core code is now larger and more RAM intensive especially
if you use the Serial class for the hardware serial ports.

--- bill

LiquidCrystal_I2C.zip (7.08 KB)

bperrybap:
Welcome to the wonderful world of Arduino 1.0
100% of the pre 1.0 libraries break and won't compile with the 1.0 release.
Better get used to it.
I attached an updated library for you.
The changes are minimal to make it work for pre 1.0 and 1.0
but this is an example of how Arduino 1.0 breaks all the existing pre 1.0 libraries.
Study it for how to correct issues that will come up on other libraries
as this will be a very common problem when using 1.0

The other alternative is to simply not upgrade to 1.0
There are very few new capabilities in 1.0 and for the most part
it simply creates lots of headaches, at least for now.
If what you had was working, there is no driving need to upgrade to 1.0
With 1.0 your code size will get larger and the available RAM for your sketch is reduced
as the Arduino 1.0 core code is now larger and more RAM intensive especially
if you use the Serial class for the hardware serial ports.

--- bill

Bill thaaaaaaaaaaaaaaaaanks so much !!!

I am aware version 1.0 is giving some headaches but sooner or later we will have to fall into it.

Your library fix worked great. I will not look into the changes to learn from it. I did try to fix it myself as i knew or guessed where the problem was but couldnt make it.
thanks again Bill.

Sergegsx:
I am aware version 1.0 is giving some headaches but sooner or later we will have to fall into it.

Sure, it is question of do you want to have to deal with those headaches
if your code is working fine on the pre 1.0 release?
Very very few people need the new features in 1.0
For the rest, 1.0 is nothing more than an inconvenience that breaks their code
and for some it completely kills their project as even when they get it to compile
it no longer fits in the AVR or the runtime code crashes due to timing or RAM resource issues.
Always using the latest and greatest s/w isn't always the right answer for everyone.
There is a reason that Microsoft's XP is still way more popular than Vista ever was.
It "just worked" for so many folks while Vista broke so many things.
and why so many businesses never transition to a new release of anything
until after the first point release.

There are some things the Arduino team could have done to provide better
backward compatibility and make it easier for folks to find the places that need to be fixed.
Arduino is supposed to "easy" and embrace novices and while the changes to make
things work on 1.0 are quite minimal, novices will simply not be able to do it
and will quickly start to get frustrated.

IMHO, the Arduino guys pushed in way too many changes at the last
minute and they will be fighting these issues at the same time
they will be wanting to make even more changes to support
the upcoming new ARM processors.

I will not look into the changes to learn from it.

I hope this is a typo... :wink:

--- bill

hahaha of course it is !!

I will NOWWWWW look into...

Just for other readers that have the same problem as Sergegsx but can't get their display working in IDE 1.0 with the updated version bperrybap attached:

The updated library posted by bperrybap is fine tuned for dfrobot.com displays.

Libraries having the exact same name is can be confusing...

For users that use the library I created in 2009 for DIY I2C to parallel conversion using a PCF8574(A) for HD44780 compatible displays, I modified my library and sample sketches and put it at its regular spot.
http://www.xs4all.nl/~hmario/arduino/LiquidCrystal_I2C/
Hope this helps to get your displays working in IDE 1.0

Mario
Jee, I've been away too long: New Arduino Uno, New IDE and even a new forum... :blush:

thanks Mario.

btw, is there a guide on how to migrate a sketch from pre1.0 to 1.0 when referring to the ethernet library?
I need to specify a gateway + fixed ip address and forget about DHCP etc.
but cant seem to do it with new version 1.0
ive tried replacing the new ethernet library with the older one but does not work because of the further changes that 1.0 has refering to print etc.
please any help
thanks a lot.

Sergegsx:
thanks Mario.

btw, is there a guide on how to migrate a sketch from pre1.0 to 1.0 when referring to the ethernet library?

Maybe Just don't upgrade???.
Seriously though, the 1.0 ethernet library has some issues in it that causes it to drag in lots
of stuff that the sketch may not be using. As a result the sketch gets quite a bit bigger.
To see this, try building the webserver example sketch. It is about 5k with 0022 and about 10k with 1.0

There will have to be an update to correct this.
So if you don't need to use 1.0 you may want to stick with 0022 or 0023 for a while longer.
This will give time for some of the nasties in 1.0 to get worked out as well as time for the 3rd party
community to update all their libraries to work again on 1.0

--- bill

bperrybap: while I appreciate your help in updating this library for Arduino 1.0, I wish you wouldn't spread so much negative FUD about the 1.0 release. Plenty of people have downloaded and are using it with little or no problems. I've actually been surprised at how few people seem to be running into issues and how quickly many libraries have been updated. While the release and its process certainly weren't perfect, it seems to be working well for many people. Plus, there are lots of nice new features / changes that make it worth upgrading.

mellis:
bperrybap: while I appreciate your help in updating this library for Arduino 1.0, I wish you wouldn't spread so much negative FUD about the 1.0 release. Plenty of people have downloaded and are using it with little or no problems. I've actually been surprised at how few people seem to be running into issues and how quickly many libraries have been updated. While the release and its process certainly weren't perfect, it seems to be working well for many people. Plus, there are lots of nice new features / changes that make it worth upgrading.

As far as "lots of nice new features/changes that make it worth upgrading" goes, that
depends on if those features were wanted/needed. If those new features were
not needed, then the cost of using the new 1.0 release can potentially be quite high particularly
if it causes something that was previously working to break.

There is no question that 1.0 can be used without any issues but it only works
with little or no problems as long as users don't use anything that the 1.0 release breaks.
So today if users are confining their sketches to use only the libraries
that are supplied with 1.0, they generally will have a very good experience and will
probably not experience any issues.
I say "probably" because even when users do not use any 3rd party pre 1.0 libraries that have
not yet been updated for 1.0, they can still experience issues when using pre 1.0 sketches
with the 1.0 supplied core code and libraries.
While most of the likely issues for users using only the 1.0 supplied libraries
will be relatively "easy to fix" items like the changing of certain function call names in
things like the wire library API, or changing a parameter type in something like print() or write(),
there are another class of issues that are not so easy to fix.
Those generally fall into 2 categories:

  • size/space (things are now larger)
  • behavior changes (API functions don't work like they used to)

For example, if you had a sketch that just barely fit, it may no longer fit using 1.0
and while it may be possible to start trimming, in some cases, it may be very difficult
or impossible to trim enough to account for the larger 1.0 code.

Some issues can be quite difficult to track down and fix
like the changes in behavior of HardwareSerial and its RAM usage.
The new HardwareSerial behaves differently and there is no way to get
back to the old behavior even if you want/need to without having to go
in and modify HardwareSerial.cpp
For example, the RX buffers are now half the size. This may cause dropped rx
data in certain applications. The TX output is now buffered, which has the
potential to break certain applications.
One example of this, would be applications that previously did delays after sending a message to avoid
overrunning a remote receiver. The delay would now happen in parallel with
the sending of the data instead of after the last character of the message is sent.

============================================
I guess my biggest beef with the 1.0 release is how it is being handled
vs what it is.
In my view the 1.0 release was handled poorly particular when it comes
to trying to help less technical users through the transition.

I try to put myself in the situation of a newbie/less technical user.
I had something that works pre 1.0, now it doesn't and I get a whole
long list of errors. Or I download this cool/nifty sketch and library
and all it does it get errors with 1.0

IMHO, if the 1.0 release were better prepared to deal with the incompatibilities that
it has chosen to force on its user base, it would have put some additional things in place
to help deal with the transition.
For example:
A user experiencing issues can go the "Installation & Troubleshooting" forum
and find a sticky which leads you to here:
http://www.arduino.cc/en/Guide/Troubleshooting#upload
There is NOTHING, not one word, on that page about Arduino 1.0 transition issues.
This page should have a link to a specific 1.0 transition page or wiki that has helpful information
on how to migrate sketches or libraries that are experiencing issues to work with 1.0

Also, instead of simply omitting files like WProgram.h and allowing the compiler
to spew out all kinds of error messages that have no meaning to newbies or
less technical folks, 1.0 could have created stub header files that use
#error to issue a nice clean error message and point users to a 1.0 transition
web page for more details on how to get things up and working again.

====

As things are now, pre 1.0 sketches that use un modified pre 1.0 libraries just break with slew
of compiler errors and the information on how to fix them in the form of a "how to"
doesn't seem to be readily available to newbies and less technical users.

And that is why I recommend people to people that are having issues
with 1.0 to consider not jumping to 1.0 just yet if they don't need any
of the 1.0 "goodies".

--- bill