Go Down

Topic: ArduIMU V3 Programming (Read 15 times) previous topic - next topic

akhter900

Hello dear,

Is ArduIMU support the following functions...

Serial.available()

sprintf(akh_bufferOut, "%f %f %f %f", 1.1, 1.2, 1.3, 1.4);
Serial.println(akh_bufferOut);


Seeking your answer.

Thank you.
Akhter

holmes4

Try looking in its manual. It's what it for!

Mark

akhter900

Dear Akhter,

sprintf(akh_bufferOut, "%f %f %f %f", 1.1, 1.2, 1.3, 1.4);
normally will provide "? ? ? ?" on your screen as output.

Please try to use dtostrf() function. The format is provided bellow.

dtostrf(float_variable, length_before_dot, length_after_dot, charBuffer);

For your problem you may use like this:
=============================

String  akh_bufferOut;
char    akh_temp[20];

dtostrf(float_var1, 3, 3, akh_temp);
akh_bufferOut = akh_temp;

dtostrf(float_var2, 3, 3, akh_temp);
akh_bufferOut = akh_bufferOut + "," + akh_temp;

dtostrf(float_var3, 3, 3, akh_temp);
akh_bufferOut = akh_bufferOut + "," + akh_temp;
   
Serial.println(akh_bufferOut);

=============================

Hope this will help.

Goodluck :-)

Go Up