diff options
author | Keith Packard <keithp@keithp.com> | 2009-11-02 21:38:18 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-11-02 23:51:41 -0800 |
commit | 144db05f6b286a0450d486f69ce192632a2c0656 (patch) | |
tree | d30523ae45f96db1ffca15b842965ed9ff008ac3 /src/ao_flight_test.c | |
parent | 17611788aadc9460287145a340a7c18bf63766aa (diff) |
Add two-point accelerometer calibration.
Calibration now uses two values, one upside right and the other upside
down instead of a single horizontal value. This allows the use of
other accelerometers and compensates for variations in the divider
circuit to provide more accurate data.
Diffstat (limited to 'src/ao_flight_test.c')
-rw-r--r-- | src/ao_flight_test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ao_flight_test.c b/src/ao_flight_test.c index 83c63016..61f48cb6 100644 --- a/src/ao_flight_test.c +++ b/src/ao_flight_test.c @@ -22,6 +22,8 @@ #include <stdlib.h> #include <string.h> +#define AO_HERTZ 100 + #define AO_ADC_RING 64 #define ao_adc_ring_next(n) (((n) + 1) & (AO_ADC_RING - 1)) #define ao_adc_ring_prev(n) (((n) - 1) & (AO_ADC_RING - 1)) @@ -144,12 +146,13 @@ ao_altitude_to_pres(int16_t alt) __reentrant struct ao_config { uint16_t main_deploy; - int16_t accel_zero_g; + int16_t accel_plus_g; + int16_t accel_minus_g; }; #define ao_config_get() -struct ao_config ao_config = { 250, 16000 }; +struct ao_config ao_config = { 250, 15937, 16467 }; #include "ao_flight.c" |