public class BuiltInAccelerometer extends java.lang.Object implements Accelerometer, LiveWindowSendable
This class allows access to the roboRIO's internal accelerometer.
Accelerometer.Range
Constructor and Description |
---|
BuiltInAccelerometer()
Constructor.
|
BuiltInAccelerometer(Accelerometer.Range range)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSmartDashboardType()
The string representation of the named data type that will be used by the smart dashboard for
this
Sendable . |
ITable |
getTable()
The table that is associated with this
Sendable . |
double |
getX()
The acceleration in the X axis.
|
double |
getY()
The acceleration in the Y axis.
|
double |
getZ()
The acceleration in the Z axis.
|
void |
initTable(ITable subtable)
Initializes a table for this
Sendable object. |
void |
setRange(Accelerometer.Range range)
Common interface for setting the measuring range of an accelerometer.
|
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.
|
public BuiltInAccelerometer(Accelerometer.Range range)
range
- The range the accelerometer will measurepublic BuiltInAccelerometer()
public void setRange(Accelerometer.Range range)
Accelerometer
setRange
in interface Accelerometer
range
- The maximum acceleration, positive or negative, that the accelerometer will
measure. Not all accelerometers support all ranges.public double getX()
getX
in interface Accelerometer
public double getY()
getY
in interface Accelerometer
public double getZ()
getZ
in interface Accelerometer
public java.lang.String getSmartDashboardType()
Sendable
Sendable
.getSmartDashboardType
in interface Sendable
Sendable
.public void initTable(ITable subtable)
Sendable
Sendable
object.public void updateTable()
LiveWindowSendable
updateTable
in interface LiveWindowSendable
public ITable getTable()
Sendable
Sendable
.public void startLiveWindowMode()
LiveWindowSendable
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
LiveWindowSendable
stopLiveWindowMode
in interface LiveWindowSendable