Use a MAX_DISTANCE instead of -1
This commit is contained in:
parent
b7e5b356d7
commit
caeccc0e2e
|
@ -7,6 +7,7 @@ namespace ratgdo {
|
|||
|
||||
static const char* const TAG = "ratgdo.sensor";
|
||||
static const int MIN_DISTANCE = 100; // ignore bugs crawling on the distance sensor & dust protection film
|
||||
static const int MAX_DISTANCE = 4500; // default maximum distance
|
||||
|
||||
void RATGDOSensor::setup()
|
||||
{
|
||||
|
@ -96,6 +97,8 @@ namespace ratgdo {
|
|||
}
|
||||
}
|
||||
|
||||
if(maxDistance < 0) maxDistance = MAX_DISTANCE;
|
||||
|
||||
//maxDistance = objCount == 0 ? -1 : pDistanceData->RangeData[objCount - 1].RangeMilliMeter;
|
||||
/*
|
||||
* if the sensor is pointed at glass, there are many error -1 readings which will fill the
|
||||
|
|
Loading…
Reference in New Issue