public class DigitalOutput extends DigitalSource implements LiveWindowSendable
channels, m_channel, m_port
interrupts, m_interrupt, m_interruptIndex, m_isSynchronousInterrupt
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPDPChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond
Constructor and Description |
---|
DigitalOutput(int channel)
Create an instance of a digital output.
|
Modifier and Type | Method and Description |
---|---|
void |
disablePWM()
Change this line from a PWM output back to a static Digital Output line.
|
void |
enablePWM(double initialDutyCycle)
Enable a PWM Output on this line.
|
void |
free()
Free the resources associated with a digital output.
|
int |
getChannel() |
java.lang.String |
getSmartDashboardType() |
ITable |
getTable() |
void |
initTable(ITable subtable)
Initializes a table for this sendable object.
|
boolean |
isPulsing()
Determine if the pulse is still going.
|
void |
pulse(int channel,
float pulseLength)
Generate a single pulse.
|
void |
pulse(int channel,
int pulseLength)
Deprecated.
Generate a single pulse. Write a pulse to the specified
digital output channel. There can only be a single pulse
going at any time.
|
void |
set(boolean value)
Set the value of a digital output.
|
void |
setPWMRate(double rate)
Change the PWM frequency of the PWM output on a Digital Output line.
|
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 |
updateDutyCycle(double dutyCycle)
Change the duty-cycle that is being generated on the line.
|
void |
updateTable()
Update the table for this sendable object with the latest
values.
|
getAnalogTriggerForRouting, getChannelForRouting, getModuleForRouting, initDigitalPort
allocateInterrupts, cancelInterrupts, disableInterrupts, enableInterrupts, readFallingTimestamp, readRisingTimestamp, requestInterrupts, requestInterrupts, setUpSourceEdge, waitForInterrupt, waitForInterrupt
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule
public DigitalOutput(int channel)
channel
- the DIO channel to use for the digital output. 0-9 are on-board, 10-25 are on the MXPpublic void free()
free
in class DigitalSource
public void set(boolean value)
value
- true is on, off is falsepublic int getChannel()
public void pulse(int channel, float pulseLength)
channel
- The channel to pulse.pulseLength
- The length of the pulse.@Deprecated public void pulse(int channel, int pulseLength)
channel
- The channel to pulse.pulseLength
- The length of the pulse.public boolean isPulsing()
public void setPWMRate(double rate)
rate
- The frequency to output all digital output PWM signals.public void enablePWM(double initialDutyCycle)
initialDutyCycle
- The duty-cycle to start generating. [0..1]public void disablePWM()
public void updateDutyCycle(double dutyCycle)
dutyCycle
- The duty-cycle to change to. [0..1]public java.lang.String getSmartDashboardType()
getSmartDashboardType
in interface Sendable
public void updateTable()
updateTable
in interface LiveWindowSendable
public void startLiveWindowMode()
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
stopLiveWindowMode
in interface LiveWindowSendable