Initial testing is not good.
BTW, I highly suggest you install a 0022 package for testing.
0022 can coexist with the 1.0 packages
so that testing can be done on both as I believe that 0022 really needs to work
and is going to be around for quite some time.
ARG!!!! backward compatibility for 2wrire stuff is also broken in 1.0!
Why oh why didn't the arduino guys provide a wrapper function to map read() to receive()
and write() to send(). Just another example of and how far reaching the 1.0 damage is
and how messed up the 1.0 transition is going to be.
These guys really need to have a "backward compatibility" mode (define) that can be set
from the IDE to allow all the old sketches to continue to compile under 1.0 - I'm going to add this to the Arduino issues list.
Back to the new lcd library.
There are some issues with the 1.0 ifdefs on the 0022 side.
Look at the declarations and code for write() in the LCD.h and LCD.cpp files:
needs to be something more like:
LCD.h
#if (ARDUINO < 100)
virtual void write(uint8_t value);
#else
virtual size_t write(uint8_t value);
#endif
LCD.cpp
#if (ARDUINO < 100)
void LCD::write(uint8_t value) {send(value, HIGH);}
#else
size_t LCD::write(uint8_t value)
{
send(value, HIGH);
return 1; // assume OK
}
#endif
Ok a few typos, those are easy to fix.
Then there is the issue of using .ino for the sketch extensions.
That doesn't work for 0022. .pde will work for both 0022 and 1.0
Ok so thats an easy one to fix as well.
There is also the 2wire issues mentioned above for 0022.
I tried to use ifdefs to replace write with send and read with receive but it wasn't enough.
I got some strange undefined references:
undefined reference to `__cxa_pure_virtual'
perhaps due to the function prototypes changing or perhaps a name collision
with the Wire library send() function.
So I never was able to get it to link on 0022. (it did build, link and work on 1.0rc2)
You will see the errors/issues when you compile the code on 0022 after you fix the write/send read/receive issue.
Now for the Grand Daddy of all problems.
"As is" the new library modules will not compile on 0022 or 1.0 unless <Wire.h> is included by the users
sketch. Existing code does not include this header so it breaks backward compatibility.
This is caused by the way the way the IDE handles its include paths.
IMHO it is a HUGE issue that caused much heartburn during the ks0108/glcd library
development. In fact it still creates issues to this day.
Here is the issue. The IDE sets the compiler include path to the Arduino core directory
plus it determines additional paths path based on the included files discovered/used in the sketch.
The sketch is compiled using that include path.
However, and here is the HUGE issue, when compiling the files for a library that the IDE detected the sketch needs,
the IDE uses the same include path as the sketch plus it also adds any directories in the library that contain headers,
to the include path when it compiles all the modules for the library.
This now creates some horrible issues. Like a library has no guaranteed way to include the header files
for another library because the base level library directory is not part of the include path and the
users sketch may not include a header from that library.
So things like
#include <Wire.h> won't work in a library unless the user sketch also includes <Wire.h> because
the necessary path is not part of the include path unless the sketch includes it.
Now you can sort of cheat and use "../Wire/Wire.h", because the library modules being compiled
are all relative to base level library directory.
However, this will not work if the user installs the library
under his personal libraries directory under his sketchbook because in that case the other
libraries may not be relative to the library and may be over in the Arduino libraries directory wherever the
IDE was installed.
You can't use <../Wire/Wire.h> because it looks like gcc doesn't allow relative paths off directories
in the include path.
The Arduino sketch building methodology simply falls apart when libraries need to be able to directly call other libraries
transparently from the users sketch.
The real answer is to always add both base level library directories to the include path.
That way you can do things like:
#include <Wire/Wire.h> or #include <glcd/glcd.h> etc... It is very clean and it is the way it should have been
done from the beginning rather than this goofy method of adding all the include paths for just the libraries that are detected as being used.
But I think convincing the Arduino team to make any changes is difficult at best.
--- bill