Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
sonar_pwm.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2020 OpenuAS
3 *
4 * Thanks to Jean-François Erdelyi & Gautier Hattenberger for ADC one
5 *
6 * This file is part of paparazzi
7 *
8 * paparazzi is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
11 * any later version.
12 *
13 * paparazzi is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with paparazzi; see the file COPYING. If not, see
20 * <http://www.gnu.org/licenses/>.
21 */
22 
37 #ifndef SONAR_PWM_H
38 #define SONAR_PWM_H
39 
40 #include "std.h"
41 
42 struct SonarPwm {
44  float offset;
45  float scale;
46  float distance;
47 };
48 
49 extern struct SonarPwm sonar_pwm; // Range sensor
50 
51 extern void sonar_pwm_init(void);
52 extern void sonar_pwm_read(void);
53 
54 #endif /* SONAR_PWM_H */
55 
void sonar_pwm_init(void)
Definition: sonar_pwm.c:109
float scale
scale to convert raw to a real distance
Definition: sonar_pwm.h:45
void sonar_pwm_read(void)
Definition: sonar_pwm.c:120
struct SonarPwm sonar_pwm
Definition: sonar_pwm.c:106
uint16_t raw
raw PWM value
Definition: sonar_pwm.h:43
float offset
offset
Definition: sonar_pwm.h:44
float distance
Distance measured.
Definition: sonar_pwm.h:46
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88