public class ADXL345_SPI extends SensorBase implements Accelerometer, LiveWindowSendable
| Modifier and Type | Class and Description |
|---|---|
static class |
ADXL345_SPI.AllAxes |
static class |
ADXL345_SPI.Axes |
Accelerometer.RangekAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPDPChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond| Constructor and Description |
|---|
ADXL345_SPI(SPI.Port port,
Accelerometer.Range range)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
free()
Free the resources used by this object
|
double |
getAcceleration(ADXL345_SPI.Axes axis)
Get the acceleration of one axis in Gs.
|
ADXL345_SPI.AllAxes |
getAccelerations()
Get the acceleration of all axes in Gs.
|
String |
getSmartDashboardType() |
edu.wpi.first.wpilibj.tables.ITable |
getTable() |
double |
getX()
Common interface for getting the x axis acceleration
|
double |
getY()
Common interface for getting the y axis acceleration
|
double |
getZ()
Common interface for getting the z axis acceleration
|
void |
initTable(edu.wpi.first.wpilibj.tables.ITable subtable)
Initializes a table for this sendable object.
|
void |
setRange(Accelerometer.Range range)
{inheritdoc}
|
void |
startLiveWindowMode()
Start having this sendable object automatically respond to
value changes reflect the value on the table.
|
void |
stopLiveWindowMode()
Stop having this sendable object automatically respond to value
changes.
|
void |
updateTable()
Update the table for this sendable object with the latest
values.
|
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModulepublic ADXL345_SPI(SPI.Port port, Accelerometer.Range range)
port - The SPI port that the accelerometer is connected torange - The range (+ or -) that the accelerometer will measure.public void free()
SensorBasefree in class SensorBasepublic void setRange(Accelerometer.Range range)
setRange in interface Accelerometerrange - The maximum acceleration, positive or negative, that the
accelerometer will measure. Not all accelerometers support all ranges.public double getX()
getX in interface Accelerometerpublic double getY()
getY in interface Accelerometerpublic double getZ()
getZ in interface Accelerometerpublic double getAcceleration(ADXL345_SPI.Axes axis)
axis - The axis to read from.public ADXL345_SPI.AllAxes getAccelerations()
public String getSmartDashboardType()
getSmartDashboardType in interface Sendablepublic void initTable(edu.wpi.first.wpilibj.tables.ITable subtable)
public void updateTable()
updateTable in interface LiveWindowSendablepublic edu.wpi.first.wpilibj.tables.ITable getTable()
public void startLiveWindowMode()
LiveWindowSendablestartLiveWindowMode in interface LiveWindowSendablepublic void stopLiveWindowMode()
LiveWindowSendablestopLiveWindowMode in interface LiveWindowSendableCopyright © 2015. All rights reserved.