![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Calibrates the accelorometer and then spits out data
Revision 1:cc13fddeedc0, committed 2011-12-05
- Comitter:
- madcowswe
- Date:
- Mon Dec 05 18:22:30 2011 +0000
- Parent:
- 0:2b2172edbc90
- Commit message:
- Stuff
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2b2172edbc90 -r cc13fddeedc0 main.cpp --- 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);