Ultrasonic distance sensor driver macros and prototypes. More...
Go to the source code of this file.
Data Structures | |
struct | _vexSonar_t |
Holds information relating to a sonar. More... | |
Typedefs | |
typedef struct _vexSonar_t | vexSonar_t |
Holds information relating to a sonar. More... | |
Enumerations | |
enum | tVexSonarChannel { kVexSonar_1 = 0, kVexSonar_2, kVexSonar_3, kVexSonar_4, kVexSonar_5, kVexSonar_Num } |
Sonar channel number. More... | |
Functions | |
void | vexSonarAdd (tVexSonarChannel channel, tVexDigitalPin pa, tVexDigitalPin pb) |
Add a sonar to the array of installed sonars. More... | |
void | vexSonarStart (tVexSonarChannel channel) |
Start a sonar by enabling the interrupt port. More... | |
void | vexSonarStop (tVexSonarChannel channel) |
Stop a sonar by disabling the interrupt port. More... | |
void | vexSonarStartAll (void) |
Enable all installed sonars. More... | |
void | vexSonarPing (tVexSonarChannel channel) |
Start 10uS pulse to initiate sonar ping. More... | |
void | vexSonarDebug (vexStream *chp, int argc, char *argv[]) |
Send useful information to debug console. More... | |
void | vexSonarRun (void) |
Start the sonar polling task if at least one sonar is installed. More... | |
int16_t | vexSonarGetCm (tVexSonarChannel channel) |
Get sonar value in cm. More... | |
int16_t | vexSonarGetInch (tVexSonarChannel channel) |
Get sonar value in inches. More... | |
Ultrasonic distance sensor driver macros and prototypes.
typedef struct _vexSonar_t vexSonar_t |
Holds information relating to a sonar.
enum tVexSonarChannel |
void vexSonarAdd | ( | tVexSonarChannel | channel, |
tVexDigitalPin | pa, | ||
tVexDigitalPin | pb | ||
) |
Add a sonar to the array of installed sonars.
[in] | channel | The sonar channel |
[in] | pa | The first input pin used by the sonar |
[in] | pb | The second input pin used by the sonat |
void vexSonarStart | ( | tVexSonarChannel | channel) |
Start a sonar by enabling the interrupt port.
[in] | channel | The sonar channel |
void vexSonarStop | ( | tVexSonarChannel | channel) |
Stop a sonar by disabling the interrupt port.
[in] | channel | The sonar channel |
void vexSonarStartAll | ( | void | ) |
Enable all installed sonars.
void vexSonarPing | ( | tVexSonarChannel | channel) |
Start 10uS pulse to initiate sonar ping.
[in] | channel | The sonar channel |
void vexSonarDebug | ( | vexStream * | chp, |
int | argc, | ||
char * | argv[] | ||
) |
Send useful information to debug console.
[in] | chp | A pointer to a vexStream object |
[in] | argc | The number of command line arguments |
[in] | argv | An array of pointers to the command line args |
void vexSonarRun | ( | void | ) |
Start the sonar polling task if at least one sonar is installed.
int16_t vexSonarGetCm | ( | tVexSonarChannel | channel) |
Get sonar value in cm.
[in] | channel | The sonar channel |
int16_t vexSonarGetInch | ( | tVexSonarChannel | channel) |
Get sonar value in inches.
[in] | channel | The sonar channel |