mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 22:48:29 -04:00
ada9c36e0c
git-svn-id: https://arducopter.googlecode.com/svn/trunk@3237 f9c3cf11-9bcb-44bc-f272-b75c42450872
17 lines
531 B
C++
17 lines
531 B
C++
#ifndef AP_RangeFinder_SharpGP2Y_H
|
|
#define AP_RangeFinder_SharpGP2Y_H
|
|
|
|
#include "RangeFinder.h"
|
|
|
|
#define AP_RANGEFINDER_SHARPEGP2Y_MIN_DISTANCE 20
|
|
#define AP_RANGEFINDER_SHARPEGP2Y_MAX_DISTANCE 150
|
|
|
|
class AP_RangeFinder_SharpGP2Y : public RangeFinder
|
|
{
|
|
public:
|
|
AP_RangeFinder_SharpGP2Y(AP_ADC *adc, ModeFilter *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
|