|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.DriverStationEnhancedIO
public class DriverStationEnhancedIO
Nested Class Summary | |
---|---|
static class |
DriverStationEnhancedIO.EnhancedIOException
|
static class |
DriverStationEnhancedIO.tAccelChannel
Accelerometer channel for enhanced IO |
static class |
DriverStationEnhancedIO.tDigitalConfig
Digital configuration for enhanced IO |
static class |
DriverStationEnhancedIO.tPWMPeriodChannels
PWM period channels for enhanced IO |
Field Summary | |
---|---|
static double |
kAccelOffset
|
static double |
kAccelScale
|
static double |
kAnalogInputReference
|
static double |
kAnalogInputResolution
|
static double |
kAnalogOutputReference
|
static double |
kAnalogOutputResolution
|
static int |
kSupportedAPIVersion
|
Method Summary | |
---|---|
double |
getAcceleration(DriverStationEnhancedIO.tAccelChannel channel)
Query an accelerometer channel on the DS IO. |
double |
getAnalogIn(int channel)
Query an analog input channel on the DS IO. |
double |
getAnalogInRatio(int channel)
Query an analog input channel on the DS IO in ratiometric form. |
double |
getAnalogOut(int channel)
Query the voltage currently being output. |
boolean |
getButton(int channel)
Get the state of a button on the IO board. |
byte |
getButtons()
Get the state of all the button channels. |
boolean |
getDigital(int channel)
Get the current state of a DIO channel regardless of mode. |
DriverStationEnhancedIO.tDigitalConfig |
getDigitalConfig(int channel)
Get the current configuration for a DIO line. |
short |
getDigitals()
Get the state of all 16 DIO lines regardless of mode. |
short |
getEncoder(int encoderNumber)
Get the position of a quadrature encoder. |
boolean |
getEncoderIndexEnable(int encoderNumber)
Get the current configuration of a quadrature encoder index channel. |
byte |
getFirmwareVersion()
Get the firmware version running on the IO board. |
boolean |
getFixedDigitalOutput(int channel)
Get the state being output on a fixed digital output. |
double |
getPWMOutput(int channel)
Get the percent duty-cycle that the PWM generator channel is configured to output. |
double |
getPWMPeriod(DriverStationEnhancedIO.tPWMPeriodChannels channels)
Get the period of a PWM generator. |
double |
getTouchSlider()
Get the value of the Capacitive Sense touch slider. |
void |
resetEncoder(int encoderNumber)
Reset the position of an encoder to 0. |
void |
setAnalogOut(int channel,
double value)
Set the analog output voltage. |
void |
setDigitalConfig(int channel,
DriverStationEnhancedIO.tDigitalConfig config)
Override the DS's configuration of a DIO line. |
void |
setDigitalOutput(int channel,
boolean value)
Set the state of a DIO line that is configured for digital output. |
void |
setEncoderIndexEnable(int encoderNumber,
boolean enable)
Enable or disable the index channel of a quadrature encoder. |
void |
setFixedDigitalOutput(int channel,
boolean value)
Set the state to output on a Fixed High Current Digital Output line. |
void |
setLED(int channel,
boolean value)
Set the state of an LED on the IO board. |
void |
setLEDs(byte value)
Set the state of all 8 LEDs on the IO board. |
void |
setPWMOutput(int channel,
double value)
Set the percent duty-cycle to output on a PWM enabled DIO line. |
void |
setPWMPeriod(DriverStationEnhancedIO.tPWMPeriodChannels channels,
double period)
Set the period of a PWM generator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double kAnalogInputResolution
public static final double kAnalogInputReference
public static final double kAnalogOutputResolution
public static final double kAnalogOutputReference
public static final double kAccelOffset
public static final double kAccelScale
public static final int kSupportedAPIVersion
Method Detail |
---|
public double getAcceleration(DriverStationEnhancedIO.tAccelChannel channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The channel number to read.
DriverStationEnhancedIO.EnhancedIOException
public double getAnalogIn(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The channel number to read. [1,8]
DriverStationEnhancedIO.EnhancedIOException
public double getAnalogInRatio(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The channel number to read. [1,8]
DriverStationEnhancedIO.EnhancedIOException
public double getAnalogOut(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The analog output channel on the DS IO. [1,2]
DriverStationEnhancedIO.EnhancedIOException
public void setAnalogOut(int channel, double value) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The analog output channel on the DS IO. [1,2]value
- The voltage to output on the channel.
DriverStationEnhancedIO.EnhancedIOException
public boolean getButton(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The button channel to read. [1,6]
DriverStationEnhancedIO.EnhancedIOException
public byte getButtons() throws DriverStationEnhancedIO.EnhancedIOException
DriverStationEnhancedIO.EnhancedIOException
public void setLED(int channel, boolean value) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The LED channel to set. [1,8]value
- True to turn the LED on.
DriverStationEnhancedIO.EnhancedIOException
public void setLEDs(byte value) throws DriverStationEnhancedIO.EnhancedIOException
value
- The state of each LED. LED1 is lsb and LED8 is msb.
DriverStationEnhancedIO.EnhancedIOException
public boolean getDigital(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The DIO channel to read. [1,16]
DriverStationEnhancedIO.EnhancedIOException
public short getDigitals() throws DriverStationEnhancedIO.EnhancedIOException
DriverStationEnhancedIO.EnhancedIOException
public void setDigitalOutput(int channel, boolean value) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The DIO channel to set. [1,16]value
- The state to set the selected channel to.
DriverStationEnhancedIO.EnhancedIOException
public DriverStationEnhancedIO.tDigitalConfig getDigitalConfig(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The DIO channel config to get. [1,16]
DriverStationEnhancedIO.EnhancedIOException
public void setDigitalConfig(int channel, DriverStationEnhancedIO.tDigitalConfig config) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The DIO line to configure. [1,16]config
- The mode to put the DIO line in.
DriverStationEnhancedIO.EnhancedIOException
public double getPWMPeriod(DriverStationEnhancedIO.tPWMPeriodChannels channels) throws DriverStationEnhancedIO.EnhancedIOException
channels
- Select the generator by specifying the two channels to which it is connected.
DriverStationEnhancedIO.EnhancedIOException
public void setPWMPeriod(DriverStationEnhancedIO.tPWMPeriodChannels channels, double period) throws DriverStationEnhancedIO.EnhancedIOException
channels
- Select the generator by specifying the two channels to which it is connected.period
- The period of the PWM generator in seconds. [0.0,0.002731]
DriverStationEnhancedIO.EnhancedIOException
public boolean getFixedDigitalOutput(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The FixedDO line to get. [1,2]
DriverStationEnhancedIO.EnhancedIOException
public void setFixedDigitalOutput(int channel, boolean value) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The FixedDO channel to set.value
- The state to set the FixedDO.
DriverStationEnhancedIO.EnhancedIOException
public short getEncoder(int encoderNumber) throws DriverStationEnhancedIO.EnhancedIOException
encoderNumber
- The quadrature encoder to access. [1,2]
DriverStationEnhancedIO.EnhancedIOException
public void resetEncoder(int encoderNumber) throws DriverStationEnhancedIO.EnhancedIOException
encoderNumber
- The quadrature encoder to reset. [1,2]
DriverStationEnhancedIO.EnhancedIOException
public boolean getEncoderIndexEnable(int encoderNumber) throws DriverStationEnhancedIO.EnhancedIOException
encoderNumber
- The quadrature encoder. [1,2]
DriverStationEnhancedIO.EnhancedIOException
public void setEncoderIndexEnable(int encoderNumber, boolean enable)
encoderNumber
- The quadrature encoder. [1,2]enable
- If true, reset the encoder in an index condition.public double getTouchSlider() throws DriverStationEnhancedIO.EnhancedIOException
DriverStationEnhancedIO.EnhancedIOException
public double getPWMOutput(int channel) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The DIO line's PWM generator to get the duty-cycle from. [1,4]
DriverStationEnhancedIO.EnhancedIOException
public void setPWMOutput(int channel, double value) throws DriverStationEnhancedIO.EnhancedIOException
channel
- The DIO line's PWM generator to set. [1,4]value
- The percent duty-cycle to output from the PWM generator. [0.0,1.0]
DriverStationEnhancedIO.EnhancedIOException
public byte getFirmwareVersion() throws DriverStationEnhancedIO.EnhancedIOException
DriverStationEnhancedIO.EnhancedIOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |