Hi!
I can't get my wifi shield work when I have SD-card in its place.
Here is an example code I've been running.
#include <SPI.h>
#include <SD.h>
#include <WiFi.h>
int x=0;
void setup() {
Serial.begin(9600);
// disable wifi while starting SD
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
Serial.print("Starting SD...");
if (!SD.begin(4)) {
Serial.println("failed");
}
else Serial.println("ok");
if(WiFi.status() == WL_NO_SHIELD) {
Serial.println(F("WiFi shield not present"));
// don't continue:
while(true);
}
Serial.println("initialization done.");
}
void loop()
{
Serial.println(x);
x=(x+1)*10;
delay(3000);
}
When I have SD-card in its slot I get:
"Starting SD...failed
WiFi shield not present"
on serial monitor.
So in this scenario arduino won't recognize either the SD or the wifi.
When I remove SD-card from wifi shield, the code runs through the setup and goes to loop. So WiFi.status() returns something else now. But !SD.begin(4) is still true.
I wonder if anyone has any suggestions? Am I missing something or using the SS-pins somehow wrong?