Is there a known problem with the SDcard working whilst also using an Ethernet connection? My code plays the wav files okay when I REM out all the network configuration code: Equally, when the network code is left in, I get an IP address okay but the SDCard fails to go into an idle state.
#include "mbed.h"
#include "wavplayer.h"
#include "SDHCFileSystem.h"
#include "EthernetNetIf.h"
#include "HTTPClient.h"
DigitalOut led1(LED1);
DigitalOut led4(LED4);
HTTPClient http;
EthernetNetIf eth;
SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs, name
int main() {
// printf("Start\n");
// printf("\r\nSetting up...\r\n");
// EthernetErr ethErr = eth.setup();
// if(ethErr)
// {
// printf("Error %d in setup.\n", ethErr);
// return -1;
// }
// printf("\r\nSetup OK\r\n");
// Open a file to write. Get the file. Close the file
//HTTPFile file("/sd/snd.wav");
//HttpResult r = http.get("http://copelj.f2s.com/talk/snd.wav", &file);
// if(r==HTTP_OK)
// {
// printf("Result :\"%d\"\n",r);
// }
// else
// {
// printf("Error %d\n", r);
// }
WavPlayer myWavPlayer;
led1 = 1 ;
printf("\r\n--------------- Starting -----------------\r\n");
myWavPlayer.play_wave("/sd/alive.wav"); // 8 bit sample size
myWavPlayer.play_wave("/sd/complete.wav"); // 8 bit sample size
printf("<<<<<<<<<<<<<<<< All done >>>>>>>>>>>>>>>>\r\n");
led1 = 0;
led4 = 1;
}
I've been looking thru this all day if someone did it before, but I was unseccessful.
My skills are certainly not high enough to make it by myself :-/
Any ideas?