![]() |
Accelerometer: Analog or Digital?
We had our accelerometer connected to an Analog port, which we thought it was, but when we printfed the Get_Analog_Value(blah) it showed up some huge number like 17439, the value that we made get_analog_value go to was a double value, and we printfed with %d, when we moved the accelerometer no value changed
should it be an int instead of double? do you think our connections might be wrong? should it be digital instead? or any other thing it might be? thanks for the help Chantilly 612 |
Re: Accelerometer: Analog or Digital?
The accelerometer is definitely an analog sensor. Make sure you have the wires connected correctly; the color code is nonstandard. Black goes to +5 volt power, red goes to ground, and white is the output to the RC.
Quote:
|
Re: Accelerometer: Analog or Digital?
Quote:
The easiest mistake to make is the colors of the wires on the accelerometer are not normal. Check the spec sheet for how they should be swapped around. Get_Analog_Value returns an int. When you printf make sure you are printing an int. The accelerometer should return a value in the neighborhood of --730 when facing up --512 when horizontal --340 when facing down |
| All times are GMT -5. The time now is 00:01. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi