November 08, 2024, 01:35:48 AM

Shield LCD16x2 with Arduino Uno

Started by franknh, June 22, 2016, 07:29:39 PM

Previous topic - Next topic

franknh

I purchased an Olimex Shield LCD16x2 unit with 16x2 LCD and 4 buttons for use with Arduino.
I downloaded the example programs and the LCD16x2 library from the website.
I plug the shield LCD board on to the Arduino Uno, load an example program (Buttons_And_LCD), but it does not compile correctly.  It is giving errors as if it cannot find the wire.h library.  I did see that the wire.h library is located in a different directories than the majority of the libraries used with Arduino.
None of the example programs can compile properly.  They all give a similar error message.  I even selected the Arduino Duemilanova w/ATmega328 board in the IDE like the readme.txt file said to do.
This made no difference and I still get the same error message.

I loaded another example program supplied with the Arduino IDE (digital potentiometer) that uses the same wire.h library and it compiled just fine and I was able to upload it to the board.
Can someone give me some tips as to what might be wrong??  I really would like to use the LCD with 4 buttons in my project.  I have the plain LCD16x2 with buttons separate, but like the 4 buttons built in on the Olimex shield because it is low cost and compact.

Thanks   :(       
Frank Medros


LubOlimex

Hey,

Did you copy the whole folder "LCD16x2" to the libraries folder of your Arduino IDE (ex. "..\arduino-x.x.x\libraries")?

What us the Arduino IDE version that you use?

Did you download the Arduino IDE from arudino.cc or from arudino.org?

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

franknh

I did copy the whole LCD16x2 folder to the arduino\library folder.
I was using arduino IDE version 1.6.8 and recently updated to 1.6.9 and had downloaded both from arduino.cc.
I didn't know there was arduino.org.

So just today I downloaded the even more updated arduino IDE 1.7.10 from arduino.org and after much fighting with the computer, and going back and forth with COM ports, etc to make sure the IDE was communicating properly with the board, I was finally able to load the example program Buttons_and_LCD and successfully compiled it and uploaded to the board and it is operating correctly.

Thanks for the quick reply and pointing me to the arduino.org site.
I am happy that it is finally working and now I can try writing some code for the shield to use in my project.  I may now purchase more units to work with.

LubOlimex

Glad you got it solved. However, this is very interesting since we used the Arduino IDE from arduino.cc to make the project. I thought you attempted to use the Arduino IDE from arduino.org... Makes me think if it is possible that Arduino guys started to detect hardware manufactured from the opposing front and block communication...

Anyway, glad it is working.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

NewtoC

I have the same problems when compiling. I use the IDE version 1.8.5 and have also tried the beta version 1.9. I have even tried different boards, Uno, Nano and Pro Mini.

The LCD16x2 file is placed under Arduino-1.8.5/libraries.

I always receive the followíng text when compiling:


:\Program Files (x86)\Arduino\libraries\LCD16x2\LCD16x2.cpp:24:26: fatal error: ../Wire/Wire.h: No such file or directory

#include "../Wire/Wire.h"

                          ^

compilation terminated.

exit status 1
Error compiling for board Arduino Pro or Pro Mini.

Being absolutely no expert I am probably doing something wrong but what ?

Regards,

LubOlimex

Hey,

Probably something with the include location or syntax between Arduino revisions. Try opening the .cpp file inside the library and change #include <../Wire/Wire.h> to #include <Wire.h>.

If the problem persists you might also try starting the example following this guide: https://www.olimex.com/Products/Duino/_resources/Arduino_instructions.pdf - just make sure to select OLIMEXINO-328 instead of Arduino UNO in the board's manager, else the LCD demo wouldn't be selectable/visible.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

NewtoC

Lub,
Thanks a lot for the quick reply and help !

Now compiling and uploading works.
However, it was not possible to change with the .cpp file inside the library. Instead I put a copy of it in another file, made the change and then reloaded it into the library.

Best regards,
Urban