Hi!
I'm new to programming in Monkey C. I wanna write a programm, which gets all the reading of the accelerometer and the magnetometer and saves it in a FIT-File.
Getting the data over Sensor.Info and saving it in an array is no problem. I was printing out the arrays in the console in Eclipse and they make perfekt sense. But when I save those arrays in a FIT-Field using the setData()-function, suddenly there are different, wrong values in the FIT-Field. (I use the Fit SDK to convert the FIT-Files to a CSV-File and import the File in Excel). I really don't know where my mistake is. I hope you can help me.
This is how I create the FIT-Fields:
When the user presses a button I start a timer which calls this function every 125ms:
Those are the printed values from the console:
XAccel: [654, 654, 654, 654, 654, 654, 654, 475]
YAccel: [476, 476, 476, 476, 476, 476, 476, 655]
ZAccel: [-586, -586, -586, -586, -586, -586, -586, -586]
Pitch: [0.496728, 0.496728, 0.496728, 0.496728, 0.496728, 0.496728, 0.496728, 0.715031]
Roll: [-2.301411, -2.301411, -2.301411, -2.301411, -2.301411, -2.301411, -2.301411, -2.460433]
XMag: [-118, -118, -118, -118, -118, -118, -118, -86]
YMag: [-86, -86, -86, -86, -86, -86, -86, -118]
ZMag: [202, 202, 202, 202, 202, 202, 202, 202]
Those are the values from my FIT-Fields:
X_Accel_Values: -1|-1|-1|-8388737|-8388737|-8388737|-8388737|-129
Y_Accel_Values: -1|-1|-1|-1|-1|-1|-1|68095
Z_Accel_Values: -256|16777215|2147483647|65407|-1|402653439|250657|0 //Interesting here: Third number is max. Integer
Pitch_Values: 4.2351647E-22|0.0|1.17549435E-38|0.0|0.0|0.0|0.0|0.0
Roll_Values: 0.0|0.0|0.0|0.0|0.0|0.0|0.0|0.0
X_Mag_Values: 0|0|0|0|0|0|0|0
Y_Mag_Values:0|0|0|0|0|0|0|0
Z_Mag_Values: -872415232|-1015597533|41205445|268435456|17195260|0|-553648128|91537093
Does anyone know why the values are different and how to fix it? Any Help is appreciated
Thanks!
Tim