|
|||||||||
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.
Field Summary |
---|
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond, n_simProperties |
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. |
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. |
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |