mirror of https://github.com/ArduPilot/ardupilot
RangeFinder: remove raw_value from SharpGP2Y
This commit is contained in:
parent
8d54e50897
commit
bf3fa8b99b
|
@ -10,11 +10,11 @@ class AP_RangeFinder_SharpGP2Y : public RangeFinder
|
|||
{
|
||||
public:
|
||||
AP_RangeFinder_SharpGP2Y(AP_HAL::AnalogSource *source, FilterInt16 *filter);
|
||||
int convert_raw_to_distance(int _raw_value) {
|
||||
if( _raw_value == 0 ) {
|
||||
int16_t convert_raw_to_distance(int16_t raw_value) {
|
||||
if (raw_value == 0) {
|
||||
return max_distance;
|
||||
} else {
|
||||
return 14500/_raw_value;
|
||||
return 14500/raw_value;
|
||||
}
|
||||
} // read value from analog port and return distance in cm
|
||||
|
||||
|
|
Loading…
Reference in New Issue