summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
98806b1)
To get an accurate baseline of the launchpad state, take a longer average of
the two sensors as the unit boots up.
Signed-off-by: Keith Packard <keithp@keithp.com>
- __pdata static uint8_t nsamples = 0;
+ __pdata static uint16_t nsamples = 0;
ao_flight_adc = ao_adc_head;
ao_raw_accel_prev = 0;
ao_flight_adc = ao_adc_head;
ao_raw_accel_prev = 0;
- * Collect 100 samples of acceleration and pressure
+ * Collect 1000 samples of acceleration and pressure
* data and average them to find the resting values
*/
* data and average them to find the resting values
*/
ao_raw_accel_sum += ao_raw_accel;
ao_raw_pres_sum += ao_raw_pres;
++nsamples;
ao_raw_accel_sum += ao_raw_accel;
ao_raw_pres_sum += ao_raw_pres;
++nsamples;