Sharing SPI (WAV Shield + MEGA +WiFly) - WiFly/WAV cable select pins

Hi,

I had the same problem with the data logging shield + RFM12B + Ethernet Shield + mega 2560. I think your problem is the same I had and it's about the CS PIN that control the SD on your Wave Shield.

Mainly, as I wanted to have an easy access to my SDCard, I chose not to use the Ethernet Shield SDCard reader.

Edit you Sd2Card.h and replace => uint8_t const SD_CHIP_SELECT_PIN = 10; by uint8_t const SD_CHIP_SELECT_PIN = 33;
Bend or cut your pin N°10 on your Wave Shield (this shield must be on the top of your stack) and add a jumper between Pin 33 and 10.
Add 4 jumpers between 11,12,13 on the Wave Shield and 51,50,52 on the mega2560.

Code:

int CS = 33; //chipselect for SDcard
int SS = 53; //standard hardware chipselect for mega2560

void setup() {

pinMode(SS, OUTPUT);
digitalWrite(SS,HIGH);
...
if (!SD.begin(CS)) {
....
}
....
digitalWrite(SS,LOW);
digitalWrite(CS,HIGH);
Ethernet.begin(mac, ip); // WiFly.begin(); in your case
...
digitalWrite(SS,HIGH);
}

I tested this solution with the Ethernet Shield V5 (Rev 2) with Success 8) but with the V6 (Rev 3) it fails :~

Let me know about the result with your WiFly Shield.

Cheers.