20 #define SONAR_OUT_OF_RANGE (-1)
24 struct sonar_hardware;
void sonar_update(struct sonar *self)
int16_t cf_alt_cm
Definition: sonar.h:35
struct sonar default_sonar
int32_t sonar_calc_altitude(struct sonar *self, float cosTiltAngle)
int32_t sonar_read(struct sonar *self)
Definition: sonar_hcsr04.h:22
float max_tilt_cos
Definition: sonar.h:37
int32_t sonar_get_altitude(struct sonar *self)
int16_t altitude
Definition: sonar.h:33
int16_t max_alt_with_tilt_cm
Definition: sonar.h:34
struct hcsr04 dev
Definition: sonar.h:32
void(* start_reading)(struct sonar *self)
Definition: sonar.h:28
int16_t max_tilt_deci_degrees
Definition: sonar.h:36
void sonar_init(struct sonar *self)
int16_t max_alt_with_tilt
Definition: sonar.h:38