15#if defined(ARDUINO_TEENSY36) || defined(ARDUINO_TEENSY41)
36 bool calibrate(
bool do_calibrate);
47 bool refine_calibration(
bool do_refinement);
61 bool get_ground_contact();
69 void get_contact_thresholds(
float &lower_threshold_percent_ground_contact,
float &upper_threshold_percent_ground_contact);
77 void set_contact_thresholds(
float lower_threshold_percent_ground_contact,
float upper_threshold_percent_ground_contact);
85 bool _calc_ground_contact();
88 uint16_t _raw_reading;
89 float _calibrated_reading;
94 const uint16_t _cal_time = 5000;
96 bool _last_do_calibrate;
97 uint16_t _calibration_min;
98 uint16_t _calibration_max;
101 const uint8_t _num_steps = 7;
102 const float _lower_threshold_percent_calibration_refinement = .33;
103 const float _upper_threshold_percent_calibration_refinement = .66;
105 bool _last_do_refinement;
106 unsigned int _step_max_sum;
108 unsigned int _step_min_sum;
111 float _calibration_refinement_min;
112 float _calibration_refinement_max;
115 bool _ground_contact;
116 const uint8_t _ground_state_count_threshold = 4;
117 float _lower_threshold_percent_ground_contact = .15;
118 float _upper_threshold_percent_ground_contact = .25;