Pages: [1]   Go Down
Author Topic: LCD library not working with Arduino 0010?  (Read 612 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
i just downloaded the LiquidCrystal library, and Arduino 0010 is giving me an "error building library" message. Specifically I get a string of errors that look like this:

LiquidCrystal.cpp:8: error: declaration of C function 'void pinMode(int, int)' conflicts with
C:\Program Files\arduino-0010-win\arduino-0010\hardware\cores\arduino/wiring.h:74: error: previous declaration 'void pinMode(uint8_t, uint8_t)' here

Any suggestions? Thanks!

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i had this problem too, think i sorted it by deleting a few lines in source. if its the 4bit library you are using try this http://rapidshare.com/files/69772115/LCD4Bit.zip.html it seems to work for me
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well that got me further, but when I include the library in a sketch and compile, I now get  the error  "In function 'main': undefined reference to 'setup' "
 smiley-sad

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interested in any solution.  I am having the same problem using the http://www.arduino.cc/playground/Code/LCD tutorial
Logged

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

Hi,

After some poking around, it seems you can make the library work just by removing the conflicting integer setups.

To do this, open up the LiquidCrystal folder and open the file LiquidCrystal.cpp in any text editor or Arduino10 itself.

At the top of the file you'll see a block of code like this:

  extern void pinMode(int, int);
  extern void digitalWrite(int, int);
  extern int digitalRead(int);
  extern void portMode(uint8_t, uint8_t);
  extern void portWrite(uint8_t, uint8_t);
  extern uint8_t portRead(uint8_t);

Replace that block with this one:

  /*extern void pinMode(int, int);*/
  /*extern void digitalWrite(int, int);*/
  /*extern int digitalRead(int);*/
  extern void portMode(uint8_t, uint8_t);
  extern void portWrite(uint8_t, uint8_t);
  extern uint8_t portRead(uint8_t);

It comments out the conflicting elements. Save the LiquidCrystal.cpp file, and completely restart Arduino10.

As long as you've got the LiquidCrystal folder inside Arduino0010/Hardware/Libraries it should build at the beginning and not throw up any errors. After you've done this, all the examples from the LCD Library page on the site work fine.

thanks
MD
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW, if you fix things like this, feel free to upload the corrected version back to the playground.  Just ask if you have any problems.
Logged

Pages: [1]   Go Up
Jump to: