sure, that would be great!
I'm currently using the following SD library:
http://arduino.cc/forum/index.php/topic,59287.0.html
as i hoped, that it would improve write speeds... It did, but only by a margin
this is where the magic happens
// create the String to be written
sprintf(strtest,"%lu-%u:%hx,%hx,%hx,%hx,%hx,%hx,%hx,%hx;\r\n",t,testId,data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7]);
// write the string
file.write(strtest);
and the "full" SD part
void setup() {
...
// initialize the SD card at SPI_HALF_SPEED to avoid bus errors with
// breadboards. use SPI_FULL_SPEED for better performance.
if (!card.init(SPI_FULL_SPEED,9)) error("card.init failed");
// initialize a FAT volume
if (!volume.init(&card)) error("volume.init failed");
// open the root directory
if (!root.openRoot(&volume)) error("openRoot failed");
// create a new file
char name[] = "RAWLOG00.TXT";
for (uint8_t i = 0; i < 100; i++) {
name[6] = i/10 + '0';
name[7] = i%10 + '0';
if (file.open(&root, name, O_CREAT | O_EXCL | O_WRITE)) break;
}
if (!file.isOpen()) error ("file.create");
...
}
uint8_t data[8];
int testId = 123;
void loop(){
// this is just to show the type of data, that is used
data[0] = B00000001;
data[1] = B00000011;
data[2] = B00000101;
data[3] = B00001001;
data[4] = B00010001;
data[5] = B00100001;
data[6] = B01000001;
data[7] = B10000001;
char strtest [52];
uint32_t tw = micros();
// create the String to be written
sprintf(strtest,"%lu-%u:%hx,%hx,%hx,%hx,%hx,%hx,%hx,%hx;\r\n",t,testId,data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7]);
// write the string
file.write(strtest);
uint32_t tw2 = micros();
uint32_t diff = tw2- tw;
// print the time it took to write the string and to sd
Serial.println(diff );
}
the uInt data array is only for demo purposes, but it shows the type of data, that i want to write ...
at the moment, im writing the data in the following format
time-id:data1,data2 ....,data7;
time2-id ....
this data is then parsed in a java program - writing raw data could work, as i don't necessarily need the log to be humanly readable.
I've already spent 2 days trying to optimize my code - so any hint would be greatly appreciated!