Go Down

Topic: LCD library not working with Arduino 0010? (Read 1 time) previous topic - next topic


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!


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


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' "




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.



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.

Go Up