beakie
New Member
OK,
I don't think my question (https://www.electro-tech-online.com/threads/processing-accelerometer-data.116380/) was clear enough. So here it is rephrased.
I get 0-255 for X, Y and Z from the Chronos EZ430.
When I line up X and Y and keep the watch static, I get 80 for Z... therefore the value for gravity must be 80.
So I divide these values by 80 which gives me a total of 1 when I add up X, Y and Z.
I have created an windows application with a projection of a 3D object which I intend to represent the rotation of the watch on.
To work out the angles (degrees) for X, Y and Z to do this rotation, I do the following.
x = (Math.Asin(X) / Math.PI * 180)
y = (Math.Asin(Y) / Math.PI * 180)
z = (Math.Asin(Z) / Math.PI * 180)
The 3D object moves almost as I would expect but there are clear bugs in my working out of these angles.
The code for the 3D object is very much proven and I use it in many other bits of code. So what is wrong with the above please?
I don't think my question (https://www.electro-tech-online.com/threads/processing-accelerometer-data.116380/) was clear enough. So here it is rephrased.
I get 0-255 for X, Y and Z from the Chronos EZ430.
When I line up X and Y and keep the watch static, I get 80 for Z... therefore the value for gravity must be 80.
So I divide these values by 80 which gives me a total of 1 when I add up X, Y and Z.
I have created an windows application with a projection of a 3D object which I intend to represent the rotation of the watch on.
To work out the angles (degrees) for X, Y and Z to do this rotation, I do the following.
x = (Math.Asin(X) / Math.PI * 180)
y = (Math.Asin(Y) / Math.PI * 180)
z = (Math.Asin(Z) / Math.PI * 180)
The 3D object moves almost as I would expect but there are clear bugs in my working out of these angles.
The code for the 3D object is very much proven and I use it in many other bits of code. So what is wrong with the above please?