Charlieplexing and SD card not working together

I have been doing a project with tinyduino, but for some reason, I can't get the sd card and led screen work together.

The SD reads fine separately, and the LED matrix always works, and when the SD card is read before the LED matrix it works, but after starting the led matrix (or starting it from the beginning), I can no longer access my sd card.

I am using the Charlieplexing library found on the tinycircuits website (and really the only library I've found online for the arduino). I am also using the PetitFS sd card library (the original had the same problem). It appears to be the Charlieplexing library that is the issue.

Cam someone please help me figure out the disconnect and help me fix this?

The library and code I'm using are attached (PetitFS:library, LolShield:library, TiltBoy:code). It breaks down after the setup. I get the ps_read error.

code.zip (257 KB)

I'm thoroughly confused by all that code in the errorHalt() function. Something went to shit, so you need to keep reading the accelerometer. Why? WTF is that about?

It's interesting, too, that you may call errorHalt() before calling accel.begin(), so reading the accelerometer in errorHalt() makes no sense.

I can't figure out from your code what pins are being used for what.

blueOkiris:
Cam someone please help me figure out the disconnect and help me fix this?

Which hardware are you trying to drive? LolShield?

The LolShield uses all the Atmega328 SPI-pins (pin-10, pin-11, pin-12, pin-13) for driving LEDs.

You cannot use the same pins for driving LEDs and for driving SPI bus devices (like SD card) at the same time.