Oskar Weigl
/
accdinttest
Calibrates the accelorometer and then spits out data
Diff: main.cpp
- Revision:
- 1:cc13fddeedc0
- Parent:
- 0:2b2172edbc90
--- a/main.cpp Mon Dec 05 18:08:44 2011 +0000 +++ b/main.cpp Mon Dec 05 18:22:30 2011 +0000 @@ -17,8 +17,8 @@ unsigned int normalacc() { int x = ainAccX.read_u16() - calibacc3ax[0]; int y = ainAccY.read_u16() - calibacc3ax[1]; - int z = ainAccZ.read_u16() - calibacc3ax[2]; - return (sqrt(float(x*x + y*y + z*z))); + //int z = ainAccZ.read_u16() - calibacc3ax[2]; + return (sqrt(float(x*x + y*y))); } void tick(){ @@ -42,7 +42,7 @@ calibacc3ax[1] /= 10000; calibacc3ax[2] /= 10000; - grav = //TODO: Make calibration for both +z and -z + //grav = //TODO: Make calibration for both +z and -z ticker.attach_us(&tick, 1000);