RangeFinder: remove raw_value from SharpGP2Y

This commit is contained in:
Randy Mackay 2014-02-10 14:57:17 +09:00
parent 8d54e50897
commit bf3fa8b99b
1 changed files with 3 additions and 3 deletions

View File

@ -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