|
2010 FRC Java API |
|||||||||
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.DigitalOutput
public class DigitalOutput
Class to read a digital input. This class will read digital inputs and return the current value on the channel. Other devices such as encoders, gear tooth sensors, etc. that are implemented elsewhere will automatically allocate digital inputs and outputs as required. This class is only for devices like switches etc. that aren't implemented anywhere else.
Field Summary |
---|
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kChassisSlots, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond |
Constructor Summary | |
---|---|
DigitalOutput(int channel)
Create an instance of a digital output. |
|
DigitalOutput(int slot,
int channel)
Create an instance of a digital output. |
Method Summary | |
---|---|
protected void |
free()
Free the resources associated with a digital output. |
boolean |
isPulsing()
Determine if the pulse is still going. |
void |
pulse(double length)
Output a single pulse on the digital output line. |
void |
set(boolean value)
Set the value of a digital output. |
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DigitalOutput(int slot, int channel)
slot
- the slot the digital module is inchannel
- the port to use for the digital outputpublic DigitalOutput(int channel)
channel
- the port to use for the digital outputMethod Detail |
---|
protected void free()
free
in class SensorBase
public void set(boolean value)
value
- true is on, off is falsepublic void pulse(double length)
length
- The pulselength in secondspublic boolean isPulsing()
|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |