Problem when my program write on my SD card. Have you idea?

i past the code and that a see on the serial monitor and that i have on my sd car

i just want past the value that you can see monitor in the file excel

an exemple is more expressive i suppose:

see pictures for anderstand more.

a part of program

while (1)

{

delay(5);

Serial.print(n,DEC);

Serial.print(“\t\t”);

bout << n;

n++;

temp2 = readval(TEMPERATURE); // Lireread regeiter of temperature value code complement A²

temp2=~temp2; // invert of the value

temp2++;// value +1

temp2=temp2&0x000000FF; // do maskavec 0x000000FF

temp2=278-temp2-7; convert kelvin to Celcuis

Serial.print(temp2,DEC);

bout << ‘;’ << temp2;

temp=readval(ACCXMSB);

temp2=temp << 8,temp2|=readval(ACCXLSB),temp2=temp2>>2,temp3=temp2*(0.00198);

Serial.print(“\t\t\t”);

Serial.print(temp3,5);

bout << ‘;’ << temp3;

temp=readval(ACCYMSB);

temp2=temp<<8,temp2|=readval(ACCYLSB),temp2=temp2>>2,temp3=temp2*(0.00198);

Serial.print(“\t\t”);

Serial.print(temp3,5);

bout << ‘;’ << temp3;

temp=readval(ACCZMSB);

temp2=temp<<8,temp2|=readval(ACCZLSB),temp2=temp2>>2,temp3=temp2*(0.00198);

Serial.print(“\t\t”);

Serial.print(temp3,5);

Serial.println();

bout << ‘;’ << temp3;

bout << endl;

logfile << buf; // log data

logfile.flush();// flush data to SD

i have found the solution of my probleme

it’s with this: obufstream bout(buf, sizeof(buf));

it’is not correctly place and the buffer and the size don’t arrive really to init themself correctly.

i show you that now that’s working correctly

But i have a last question how do you do to write number with more décimal.

you can see on png file acceleration Z 1.03; 1.02

and i want 1.02366 for example

if i founds before a reply i give the solution

think you for your good work for the site sparkfun, excelent good job sincerly.

hile (1)

{

delay(5);

Serial.print(n,DEC);

Serial.print(“\t\t”);

obufstream bout(buf, sizeof(buf)); :mrgreen: // at the begining it is place out the fonction

bout << n;

n++;

temp2 = readval(TEMPERATURE); // Lire le registre de la temperature

temp2=~temp2;

temp2++;

temp2=temp2&0x000000FF; // faire un masque avec 0x000000FF

temp2=278-temp2-7;

Serial.print(temp2,DEC);

bout << ‘;’ << temp2;

temp=readval(ACCXMSB);

temp2=temp << 8,temp2|=readval(ACCXLSB),temp2=temp2>>2,temp3=temp2*(0.00198);

Serial.print(“\t\t\t”);

Serial.print(temp3,5);

bout << ‘;’ << temp3;

temp=readval(ACCYMSB);

temp2=temp<<8,temp2|=readval(ACCYLSB),temp2=temp2>>2,temp3=temp2*(0.00198);

Serial.print(“\t\t”);

Serial.print(temp3,5);

bout << ‘;’ << temp3;

temp=readval(ACCZMSB);

temp2=temp<<8,temp2|=readval(ACCZLSB),temp2=temp2>>2,temp3=temp2*(0.00198);

Serial.print(“\t\t”);

Serial.print(temp3,5);

Serial.println();

bout << ‘;’ << temp3;

bout << endl;

logfile << buf; // log data

logfile.flush();// flush data to SD

}