Skip to content

Commit

Permalink
ModulinoDistance: wrap isnan() check in helper API
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Jun 11, 2024
1 parent 7791e03 commit a7b7ddc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Modulino.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ class ModulinoDistance : public Module {
return NAN;
}
}
bool isValid(float distance) {
return !isnan(distance);
}
private:
VL53L4CD* tof_sensor = nullptr;
VL53L4CD_Result_t results;
Expand Down

0 comments on commit a7b7ddc

Please sign in to comment.