mirror of
https://github.com/ratgdo/esphome-ratgdo.git
synced 2025-02-09 01:04:30 +00:00
Compare commits
1 Commits
dbf0a86cc9
...
52ed86323c
Author | SHA1 | Date | |
---|---|---|---|
|
52ed86323c |
@ -87,14 +87,7 @@ namespace ratgdo {
|
||||
status = this->distance_sensor_.VL53L4CX_GetMultiRangingData(pDistanceData);
|
||||
objCount = pDistanceData->NumberOfObjectsFound;
|
||||
|
||||
for (int i = 0; i < distanceData.NumberOfObjectsFound; i++) {
|
||||
VL53L4CX_TargetRangeData_t *d = &pDistanceData->RangeData[i];
|
||||
if (d->RangeStatus == 0) {
|
||||
maxDistance = std::max(maxDistance, d->RangeMilliMeter);
|
||||
}
|
||||
}
|
||||
|
||||
//maxDistance = objCount == 0 ? -1 : pDistanceData->RangeData[objCount - 1].RangeMilliMeter;
|
||||
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
|
||||
* vector with out of range data. The sensor should be sensitive enough to detect the floor
|
||||
|
Loading…
x
Reference in New Issue
Block a user