Go Down

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

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

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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy