changing colorlcdlibrary


I got a arduino uno + ethernetshield + colorLcd shield (sparkfun) stacked together.

I am getting problems as soon as a try using the libraries sd.h and colorlcdshield.h in the same sketch. Seperate they work fine, just not together.

It seems the problem is the usage of pin 4. The colorlcd uses this pin as in input for a button, while it is the chip select for the sd card.

I can scratch the copper path of the button om the lcd shield without problems. The problem is I want to change the library so that it does not not use pin 4 at all. I hope that will do the trick.

I looked in the library but can't get around on how to do this. There are a lot of code i haven't used before. Could someone help me out?


You mention a library but don't give a link to it or say which version - both are useful.

Ok, The colorlcd libraryy can be found here : The SD library is the one from arduino that comes with the software.

I Tried to make this change to the colorlcd lib yesterday but i stil got a error.

change : //DDRD = 0x00; //Hier zit waarschijnlijk het probleem, alles staat op ingang DDRD = DDRD | B00101000; //Nu enkel pinnen 3 en 5 als ingang zetten, de rest laten zoals ze zijn //PORTD = 0xFF; //vermoedlijk ook probleem PORTD = PORTD | B00101000; //enkel pinnen 3 en 5 op 1, rest laten


In file included from C:\arduino-1.0.1\libraries\SD/utility/Sd2Card.h:26, from C:\arduino-1.0.1\libraries\SD/utility/SdFat.h:27, from C:\arduino-1.0.1\libraries\SD/SD.h:20, from test_scherm_data_sd.cpp:7: C:\arduino-1.0.1\libraries\SD/utility/Sd2PinMap.h:282: error: expected unqualified-id before numeric constant


Use this:

Not this:

The first is the correct way of declaring binary literals, the second is something that Arduino made up for some obscure reason.

The alternative is to add this to the top of that file:
#include <binary.h>

ok, made that change and compiled again. I still get the same error. :~

I don't understand the error message what does it mean?

Could you post your edited version of Sd2PinMap.h

i placed it in attachement.

But i did not change anything here. only the labrary h file frome colorlcd lib. (also put in attach)
What does it do?

Sd2PinMap.h (12.4 KB)

ColorLCDShield.cpp (12.6 KB)