mirror of https://github.com/ArduPilot/ardupilot
uncrustify libraries/AP_RangeFinder/AP_RangeFinder_SharpGP2Y.h
This commit is contained in:
parent
9c45c74d97
commit
c60cfb33f2
|
@ -8,14 +8,14 @@
|
|||
|
||||
class AP_RangeFinder_SharpGP2Y : public RangeFinder
|
||||
{
|
||||
public:
|
||||
AP_RangeFinder_SharpGP2Y(AP_AnalogSource *source, FilterInt16 *filter);
|
||||
int convert_raw_to_distance(int _raw_value) {
|
||||
if( _raw_value == 0 )
|
||||
return max_distance;
|
||||
else
|
||||
return 14500/_raw_value;
|
||||
} // read value from analog port and return distance in cm
|
||||
public:
|
||||
AP_RangeFinder_SharpGP2Y(AP_AnalogSource *source, FilterInt16 *filter);
|
||||
int convert_raw_to_distance(int _raw_value) {
|
||||
if( _raw_value == 0 )
|
||||
return max_distance;
|
||||
else
|
||||
return 14500/_raw_value;
|
||||
} // read value from analog port and return distance in cm
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue