Thread: Analog Inputs
View Single Post
  #5   Spotlight this post!  
Unread 13-03-2006, 13:08
bush's Avatar
bush bush is offline
Registered User
AKA: Aaron
FRC #0710 (Pine Crest School)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Fort Lauderdale, Florida
Posts: 42
bush has a spectacular aura aboutbush has a spectacular aura about
Send a message via AIM to bush
Re: Analog Inputs

ahh thanks I understand now

So for example...
The dual-axis accelerometer supplied in the kit has a sensitivity of 290mV per g (acceleration due to gravity) and a range of +/- 2g. So the accelerometer reports voltages in the range of 1.92 - 3.08, and Get_Analog_Value(rc_ana_in01) would return values in the range from 393 - 631. Then I can convert that number into units of g with...

Code:
(Get_Analog_Value(rc_ana_in01) - 512) * 5.0 / 1024 / 0.290
??