public class AnalogAccelerometer extends SensorBase implements PIDSource, LiveWindowSendable
PIDSource.PIDSourceParameter
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPDPChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond
Constructor and Description |
---|
AnalogAccelerometer(AnalogInput channel)
Create a new instance of Accelerometer from an existing AnalogChannel.
|
AnalogAccelerometer(int channel)
Create a new instance of an accelerometer.
|
Modifier and Type | Method and Description |
---|---|
void |
free()
Delete the analog components used for the accelerometer.
|
double |
getAcceleration()
Return the acceleration in Gs.
|
String |
getSmartDashboardType() |
edu.wpi.first.wpilibj.tables.ITable |
getTable() |
void |
initTable(edu.wpi.first.wpilibj.tables.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.
|
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule
public AnalogAccelerometer(int channel)
channel
- The channel number for the analog input the accelerometer is connected topublic AnalogAccelerometer(AnalogInput channel)
channel
- The existing AnalogInput object for the analog input the accelerometer is connected topublic 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()
public String getSmartDashboardType()
getSmartDashboardType
in interface Sendable
public void initTable(edu.wpi.first.wpilibj.tables.ITable subtable)
public edu.wpi.first.wpilibj.tables.ITable getTable()
public void updateTable()
updateTable
in interface LiveWindowSendable
public void startLiveWindowMode()
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
stopLiveWindowMode
in interface LiveWindowSendable
Copyright © 2015. All rights reserved.