#include <frc/simulation/SPIAccelerometerSim.h>
◆ SPIAccelerometerSim()
frc::sim::SPIAccelerometerSim::SPIAccelerometerSim |
( |
int |
index | ) |
|
|
explicit |
Construct a new simulation object.
- Parameters
-
index | the HAL index of the accelerometer |
◆ GetActive()
bool frc::sim::SPIAccelerometerSim::GetActive |
( |
| ) |
const |
Check whether the accelerometer is active.
- Returns
- true if active
◆ GetRange()
int frc::sim::SPIAccelerometerSim::GetRange |
( |
| ) |
const |
Check the range of this accelerometer.
- Returns
- the accelerometer range
◆ GetX()
double frc::sim::SPIAccelerometerSim::GetX |
( |
| ) |
const |
Measure the X axis value.
- Returns
- the X axis measurement
◆ GetY()
double frc::sim::SPIAccelerometerSim::GetY |
( |
| ) |
const |
Measure the Y axis value.
- Returns
- the Y axis measurement
◆ GetZ()
double frc::sim::SPIAccelerometerSim::GetZ |
( |
| ) |
const |
Measure the Z axis value.
- Returns
- the Z axis measurement
◆ RegisterActiveCallback()
Register a callback to be run when this accelerometer activates.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterRangeCallback()
Register a callback to be run whenever the range changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterXCallback()
Register a callback to be run whenever the X axis value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterYCallback()
Register a callback to be run whenever the Y axis value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterZCallback()
Register a callback to be run whenever the Z axis value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::SPIAccelerometerSim::ResetData |
( |
| ) |
|
Reset all simulation data of this object.
◆ SetActive()
void frc::sim::SPIAccelerometerSim::SetActive |
( |
bool |
active | ) |
|
Define whether this accelerometer is active.
- Parameters
-
◆ SetRange()
void frc::sim::SPIAccelerometerSim::SetRange |
( |
int |
range | ) |
|
Change the range of this accelerometer.
- Parameters
-
range | the new accelerometer range |
◆ SetX()
void frc::sim::SPIAccelerometerSim::SetX |
( |
double |
x | ) |
|
Change the X axis value of the accelerometer.
- Parameters
-
x | the new reading of the X axis |
◆ SetY()
void frc::sim::SPIAccelerometerSim::SetY |
( |
double |
y | ) |
|
Change the Y axis value of the accelerometer.
- Parameters
-
y | the new reading of the Y axis |
◆ SetZ()
void frc::sim::SPIAccelerometerSim::SetZ |
( |
double |
z | ) |
|
Change the Z axis value of the accelerometer.
- Parameters
-
z | the new reading of the Z axis |
The documentation for this class was generated from the following file: