View Single Post
  #2   Spotlight this post!  
Unread 28-01-2013, 21:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming acc/gyro

I suggest you look at the ADXL345 I2C Accelerometer example project to get started.

To measure your tilt, read the horizontal (either X or Y) and vertical (Z) acceleration axes and feed them into a rectangular-to-polar coordinate conversion function. The angle output will tell you which direction is "up" according to gravity.
Reply With Quote