Library for setting up the Parallax X-Band Motion Detector.
Dependents: Parallax_XBAND_Demo Motion_Detection_Parallax
xband Class Reference
Wrapper for the Parallax X-Band Motion Detector. More...
#include <Parallax_X-Band.h>
Public Member Functions | |
xband (PinName pin_enable, PinName pin_input) | |
Initialize the xband motion detector and setup interrupts on specified pins. | |
~xband () | |
Destructor. | |
void | enable (bool enable) |
Subroutine to enable and disable the detector. | |
int | read_count () |
Get count value and return it as an integer. | |
void | reset_count () |
Resets the count variable to 0. | |
bool | velocityack () |
Checks if a new velocity value has been calculated. | |
float | read_velocity () |
Get current velocity reading in ticks/sec. | |
operator float () | |
Default overload to read velocity. |
Detailed Description
Wrapper for the Parallax X-Band Motion Detector.
Definition at line 8 of file Parallax_X-Band.h.
Constructor & Destructor Documentation
xband | ( | PinName | pin_enable, |
PinName | pin_input | ||
) |
Initialize the xband motion detector and setup interrupts on specified pins.
Initialize the xband motion detector and setup interrupts.
Default is to be disabled.
- Parameters:
-
pin_enable Enable pin. Connected to EN on xband. pin_input Data pin. Connected to OUT on xband.
Definition at line 9 of file Parallax_X-Band.cpp.
~xband | ( | ) |
Destructor.
Definition at line 34 of file Parallax_X-Band.cpp.
Member Function Documentation
void enable | ( | bool | enable ) |
Subroutine to enable and disable the detector.
- Parameters:
-
enable True to enable, False to disable.
Definition at line 43 of file Parallax_X-Band.cpp.
operator float | ( | ) |
Default overload to read velocity.
- Returns:
- Float value of currently measured velocity.
Definition at line 118 of file Parallax_X-Band.cpp.
int read_count | ( | ) |
Get count value and return it as an integer.
- Returns:
- Integer value of current count.
Definition at line 78 of file Parallax_X-Band.cpp.
float read_velocity | ( | ) |
Get current velocity reading in ticks/sec.
Sets a flag to false to indicate a stale value after reading.
- Returns:
- Float value of currently measured velocity.
Definition at line 88 of file Parallax_X-Band.cpp.
void reset_count | ( | ) |
Resets the count variable to 0.
Definition at line 97 of file Parallax_X-Band.cpp.
bool velocityack | ( | ) |
Checks if a new velocity value has been calculated.
- Returns:
- True if a new velocity value is avaliable. False if the value has already been read.
Definition at line 108 of file Parallax_X-Band.cpp.
Generated on Wed Jul 13 2022 08:09:31 by 1.7.2