|
| sonar (int32_t index) |
| Creates a new sonar sensor object on the port specified in the parameter.
|
|
bool | installed () |
|
int32_t | value () |
| Gets the value of the sonar sensor.
|
|
void | setMaximum (double distance, distanceUnits units) |
|
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 | objectDetected (void(*callback)(void)) |
| Calls a function when the sonar detect an object.
|
|
void | changed (void(*callback)(void)) |
| Calls a function when the sonar value changes.
|
|
| device (int32_t index) |
|
IQ_DeviceType | type () |
|
int32_t | index () |
|
void | init (int32_t index) |
|
int32_t | readDigitalPin () |
|
int32_t | readAnalogPin () |
|
|
void | setPollInterval (int32_t value) |
|
bool | pollValid (bool bSave) |
|
int16_t | _index |
|
Definition at line 26 of file vex_sonar.h.
◆ sonar()
vex::sonar::sonar |
( |
int32_t | index | ) |
|
Creates a new sonar sensor object on the port specified in the parameter.
- Parameters
-
port | index to the brain port. |
◆ changed()
void vex::sonar::changed |
( |
void(* | callback )(void) | ) |
|
Calls a function when the sonar value changes.
- Parameters
-
callback | A reference to a function. |
◆ distance()
double vex::sonar::distance |
( |
distanceUnits | units | ) |
|
Gets the value of the sonar sensor.
- Returns
- Returns an integer that represents the unit value specified by the parameter of the sonar sensor.
- Parameters
-
units | The measurement unit for the sonar device. |
◆ foundObject()
bool vex::sonar::foundObject |
( |
| ) |
|
Gets an object is present in front of the sonar sensor.
- Returns
- Returns a boolean that will be true if the sonar sensor is detecting an object.
◆ installed()
bool vex::sonar::installed |
( |
| ) |
|
|
virtual |
◆ objectDetected()
void vex::sonar::objectDetected |
( |
void(* | callback )(void) | ) |
|
Calls a function when the sonar detect an object.
- Parameters
-
callback | A reference to a function. |
◆ value()
int32_t vex::sonar::value |
( |
| ) |
|
|
virtual |
Gets the value of the sonar sensor.
- Returns
- Returns an integer that represents the distance to the largest object in mm
Reimplemented from vex::device.
The documentation for this class was generated from the following file: