From 1b8d7313504240ed04e0747e9b0f6e9a83d323e2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 16 Jan 2011 15:57:15 -0800 Subject: [PATCH] altos: Auto-calibrate linux-based flight testing code Use the provided ground acceleration average to set the two accelerometer calibration values so that the flight code will detect pad/idle mode correctly. Signed-off-by: Keith Packard --- src/ao_flight_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ao_flight_test.c b/src/ao_flight_test.c index e0cfa47a..108d2c19 100644 --- a/src/ao_flight_test.c +++ b/src/ao_flight_test.c @@ -238,6 +238,8 @@ ao_sleep(void *wchan) switch (type) { case 'F': ao_flight_ground_accel = a; + ao_config.accel_plus_g = a; + ao_config.accel_minus_g = a + 530; ao_flight_started = 1; break; case 'S': -- 2.30.2