Pages: [1]   Go Down
Author Topic: compiling errors <LCD4Bit.h>|<LCD4Bit_mod.h>  (Read 5087 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

OS:Windows 7
board:arduino Uno
IDE:arduino-1.0
shield:KeyPadLCDShield

I get errors when compiling the sketch with the #include <LCD4Bit.h> old LCD library, this shield (KeyPadLCDShield from muelectronic) requires this library or the <LCD4Bit_mod.h> in order to work.
sketch>import library>LCD4Bit adds <LCD4Bit.h> in the IDE text editor.
The program never compiles, even with the first one nor the second one, the compiler sends me error messages.

arduino-1.0-windows\arduino-1.0\libraries\LCD4Bit\LCD4Bit.cpp:29:57: error: WConstants.h: No such file or directory
.........
arduino-1.0-windows\arduino-1.0\libraries\LCD4Bit\LCD4Bit.cpp:225: error: 'delay' was not declared in this scope

tested with
#include <LiquidCrystal.h>
void setup(){};  
void loop(){};
compiles successfully!
« Last Edit: December 18, 2011, 10:19:42 pm by keyz01 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OS:Windows XP
board:arduino Uno
IDE:arduino-1.0
shield:KeyPadLCDShield

Hello!
Also newbie, I have the same problem.
I googled a bit, but did not find anything useful.
Could you solve this issue?
Thanks for helping a more newbie than you!
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 147
Posts: 6038
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Open this file.
arduino-1.0-windows\arduino-1.0\libraries\LCD4Bit\LCD4Bit.cpp
At line 29, you should find this
#include <WConstants.h>
Change to
#include <Arduino.h>
The delay declaration in now in that file in V1.0.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have no luck as well.

I have Win7, Arduino IDE 1.0, Duemanilove

I changed line 29 in the CPP file as above to from WContstants.h to Arduino.h

It still has a whole pile of compiler errors.

Anything else I am missing?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just received my LCD shield and had the same problem. Looking at some other libraries that are (made) v1.0 compatible, I figured out that for it to work with v1.0 arduino code, you don't need all the other libraries, just Arduino.h and the LCD4Bit_mod.h. I changed the headers in the LCD4Bit_mod.cpp file to look like this:

#include "LCD4Bit_mod.h"
#if (ARDUINO < 100)
  extern "C" {
    #include <stdio.h>  //not needed yet
    #include <string.h> //needed for strlen()
    #include <inttypes.h>
    #include "WProgram.h"
  }
#else
  #include <Arduino.h>
#endif

It now works for v1.0 and it SHOULD still work for older Arduino versions (although I have not tested that).

Hope it helps,

Robert :-)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Robert, that worked for me on my Uno rev3!

cheers,

Arthur
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all!
I'm absolutely new here, and new on using arduino 'by myself'. I've read all what i found here about "Cannot find WConstants.h", and still cant find the problem. I'm trying to use one of the stepper motor control provided with the last version of arduino software, reporting:

In file included from stepper_speedControl.ino:20:
/Users/xxx/Documents/Arduino/libraries/Stepper/Stepper.h:52:24: error: WConstants.h: No such file or directory

but there is no reference to that "WConstants.h" file neither on that stepper.h, or .cpp or everywhere in my arduino instalation :/

I know you'll hate me, and maybe you'll ban me, but... i cant understand (yet..) smiley-sad

Thanks a lot.

Javi

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I solved the problem by downgrading from version 1.0 to 0023.
See that post http://forum.arduino.cc/index.php/topic,96356.0.html
LCD4Bit_mod is not compatible with versions > arduino 0.23.
And also notice it have to be use with HD44780 LCD driver.
« Last Edit: September 25, 2013, 04:30:44 pm by keyz01 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you Robert !

It's working for me too smiley with arduino 1.0.5-r2
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
Lexington, KY
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks.  This fix worked for the code that comes with the SainSmart LCD Keypad Shield. 
Logged

Pages: [1]   Go Up
Jump to: