Quote:
|
Originally Posted by Mark McLeod
Yea, you can always manipulate the value to print it.
E.g.,
Code:
#define ACCURACY 1000 //How many decimal places are important to you
float f;
int i, i2; // Might need to be longs if you have a lot of significant digits
f = 245.56;
/* Print float value */
i = (int) f;
i2 = (int) ((f-i)*ACCURACY);
printf("f = %d.%03d \r", i, i2); //e.g., f = 245.559
|
I wish I had taken a class so I knew C. Could you write it so it takes the value in degrees from get_gyro_angle() and uses it in a sin function. I have spen 9 hours (seriously) and I still cannot get the right value. Any help is greatly appreciated.