14#ifndef VEX_SONAR_CLASS_H
15#define VEX_SONAR_CLASS_H
45 void setMaximum(
double distance, distanceUnits units );
76 uint32_t _maxdistance;
77 uint32_t _mindistance;
80 enum class tEventType {
85 void setMinimum(
double distance, distanceUnits units );
86 void setFilter( uint32_t
value );
87 void setBrightnessThreshold( uint32_t
value );
89 uint32_t distanceToRaw(
double distance, distanceUnits units );
90 double rawToDistance( uint32_t raw, distanceUnits units );
Use the distance class to control the distance sensor.
void objectDetected(void(*callback)(void))
Calls a function when the sonar detect an object.
double distance(distanceUnits units)
Gets the value of the sonar sensor.
bool foundObject()
Gets an object is present in front of the sonar sensor.
void changed(void(*callback)(void))
Calls a function when the sonar value changes.
sonar(int32_t index)
Creates a new sonar sensor object on the port specified in the parameter.
int32_t value()
Gets the value of the sonar sensor.
Bumper switch device class