Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I'm trying to write binary data to my SD-card in append mode. The result is flashing error leds. Can anybody see why my code doesn't work?
Thank you
#include "SDFileSystem.h" SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs, name FILE *fp = fopen("/sd/meteodata.bin", "ab"); if (fp ==NULL) { error("Could not open file for append\n"); led2 = led3 = 1; } else { fwrite(&ctTime,sizeof(ctTime),1,fp); fwrite(&meteo_data,sizeof(meteo_data),1,fp); } fclose(fp);