Pages: [1]   Go Down
Author Topic: Working with "LCD keypad shield"  (Read 801 times)
0 Members and 1 Guest are viewing this topic.
Israel
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I finally got a LCD keypad shield, downloaded and placed the library .c files in the designated place as instructed, but when I tried to run one of the examples it gave me a ton of errors and couldn't compile.

These errors include:

C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:29:57: error: WConstants.h: No such file or directory
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::pulseEnablePin()':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:58: error: 'LOW' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:58: error: 'digitalWrite' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:59: error: 'delayMicroseconds' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:61: error: 'HIGH' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:64: error: 'delay' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::pushNibble(int)':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:73: error: 'digitalWrite' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::commandWriteNibble(int)':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:99: error: 'LOW' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:99: error: 'digitalWrite' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::commandWrite(int)':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:106: error: 'LOW' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:106: error: 'digitalWrite' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::print(int)':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:118: error: 'HIGH' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:118: error: 'digitalWrite' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:119: error: 'LOW' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::clear()':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:139: error: 'delay' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::init()':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:146: error: 'OUTPUT' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:146: error: 'pinMode' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:154: error: 'delay' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:160: error: 'delayMicroseconds' was not declared in this scope
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::leftScroll(int, int)':
C:\Users\VincentK\Documents\Arduino\libraries\LCD4Bit_mod\LCD4Bit_mod.cpp:225: error: 'delay' was not declared in this scope



Any idea what's the problem or how to solve it?

BTW: new to this forum, so nice to meet everyone and hope to get along with you.  smiley
Logged

Dee Why NSW
Offline Offline
Full Member
***
Karma: 5
Posts: 206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You refer to a .c file. The library contains a .h and .cpp file. Check that the library is with all the other libraries and contains those two types. It looks like the .cpp is missing.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So I finally got a LCD keypad shield, downloaded and placed the library .c files in the designated place as instructed, but when I tried to run one of the examples it gave me a ton of errors and couldn't compile.

Let me guess ... you got it from SainSmart.

Sorry to sound so cynical, but it's not the first time this has come up.

Check out some of these and if they don't help then come back here with a link to your device datasheet, a picture of your setup, and a copy of your code.


http://arduino.cc/forum/index.php?topic=126048.0
http://arduino.cc/forum/index.php?topic=98472.5;
http://arduino.cc/forum/index.php?topic=116450.0;
http://arduino.cc/forum/index.php?topic=96168.0
http://arduino.cc/forum/index.php?topic=96747.0
http://arduino.cc/forum/index.php?topic=101011.0

Quote
downloaded and placed the library .c files in the designated place as instructed

A link to these instructions would help so we can determine if they are correct (current) and/or if you interpreted them correctly.


Don
« Last Edit: December 18, 2012, 03:11:56 pm by floresta » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Check that the library is with all the other libraries ....

Don't the downloaded libraries, those not supplied with the IDE, go elsewhere?

Don
Logged

Dee Why NSW
Offline Offline
Full Member
***
Karma: 5
Posts: 206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
Quote
Check that the library is with all the other libraries ....

Don't the downloaded libraries, those not supplied with the IDE, go elsewhere?

No

What am I missing or misinterpreting here? --> http://arduino.cc/en/Guide/Libraries

The way I read it your downloaded libraries wind up in a subfolder with your 'Documents' whereas the libraries that came with the IDE wind up in a subfolder with the executable.


Don

Logged

Dee Why NSW
Offline Offline
Full Member
***
Karma: 5
Posts: 206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What am I missing or misinterpreting here?

Who knows? 

Maybe your guide is out of date. You surely don't need me to tell that it wouldn't be the first time.

My libraries are all in one folder. This can only be for one of two reasons:

1. I followed instructions - official or otherwise.

Or 2. I did the bleeding obvious.

and, guess what? It has never been a problem.

Further, if the OP  has never downloaded a library before, and does the same, he/she is not likely to have a problem either.

And, in the unlikely event he has two "all the other libraries", either will do.

Maybe you are using an older IDE.......

Then maybe the OP is too. It isn't likely but, in that case, he has probably worked out what to do.
Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2347
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys,
The IDE looks for libraries in multiple places.
It looks in the "libraries" directory underneath where the IDE s/w is installed
and then it also looks in the "libraries" directory underneath your sketchbook
library which you can see or  set using [File]->[Preferences]

My guess (hard to well without seeing the verbose output and all the error messages)
is that the library is old and does not work with the 1.x IDE s/w because
of the non backward compatible changes that the Arduino team made in 1.x s/w.

I wish this LCD4bit_mod code would die and go away as it simply is not needed.

The real bit of advice here is that no 3rd party library is needed to use the LCD
on the LCD keypad shields. The LiquidCrystal library that ships with the IDE
will work just fine. It is just a matter of properly configuring the constructor
by putting in the correct pins for the shield.

VincentK,
my recommendation would be to remove the LCD4bit stuff and use
the LiquidCrystal library that came with the IDE.
You will have to fill in the LiquidCrystal constructor with the pins that are used
for your shield.
If need help figuring out the pins for the constructor,
we can help you, if you can provide a link to the shield you have.
The reason that we need to know which particular shield is that
lcd keypad shields don't all use the same pins to the control the LCD.

--- bill
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bill:

Where were you when I needed you?


Don
Logged

Pages: [1]   Go Up
Jump to: