|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.SensorBase
edu.wpi.first.wpilibj.Accelerometer
public class Accelerometer
Handle operation of the accelerometer. The accelerometer reads acceleration directly through the sensor. Many sensors have multiple axis and can be treated as multiple devices. Each is calibrated by finding the center value over a period of time.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface edu.wpi.first.wpilibj.PIDSource |
---|
PIDSource.PIDSourceParameter |
Field Summary |
---|
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond |
Constructor Summary | |
---|---|
Accelerometer(AnalogChannel channel)
Create a new instance of Accelerometer from an existing AnalogChannel. |
|
Accelerometer(int channel)
Create a new instance of an accelerometer. |
|
Accelerometer(int slot,
int channel)
Create new instance of accelerometer. |
Method Summary | |
---|---|
void |
free()
Delete the analog components used for the accelerometer. |
double |
getAcceleration()
Return the acceleration in Gs. |
java.lang.String |
getSmartDashboardType()
|
ITable |
getTable()
|
void |
initTable(ITable subtable)
Initializes a table for this sendable object. |
double |
pidGet()
Get the Acceleration for the PID Source parent. |
void |
setSensitivity(double sensitivity)
Set the accelerometer sensitivity. |
void |
setZero(double zero)
Set the voltage that corresponds to 0 G. |
void |
startLiveWindowMode()
Analog Channels don't have to do anything special when entering the LiveWindow. |
void |
stopLiveWindowMode()
Analog Channels don't have to do anything special when exiting the LiveWindow. |
void |
updateTable()
Update the table for this sendable object with the latest values. |
Methods inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Accelerometer(int channel)
channel
- the port that the accelerometer is on on the default modulepublic Accelerometer(int slot, int channel)
slot
- the slot that the module is inchannel
- the port that the Accelerometer is on on the modulepublic Accelerometer(AnalogChannel channel)
channel
- an already initialized analog channelMethod Detail |
---|
public void free()
free
in class SensorBase
public double getAcceleration()
public void setSensitivity(double sensitivity)
sensitivity
- The sensitivity of accelerometer in Volts per G.public void setZero(double zero)
zero
- The zero G voltage.public double pidGet()
pidGet
in interface PIDSource
public java.lang.String getSmartDashboardType()
getSmartDashboardType
in interface Sendable
public void initTable(ITable subtable)
initTable
in interface Sendable
subtable
- The table to put the values in.public ITable getTable()
getTable
in interface Sendable
public void updateTable()
updateTable
in interface LiveWindowSendable
public void startLiveWindowMode()
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
stopLiveWindowMode
in interface LiveWindowSendable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |