2010 FRC Java API


edu.wpi.first.wpilibj
Class DigitalOutput

java.lang.Object
  extended by edu.wpi.first.wpilibj.SensorBase
      extended by edu.wpi.first.wpilibj.DigitalOutput

public class DigitalOutput
extends SensorBase

Class to write digital outputs. This class will wrtie digital outputs. Other devices that are implemented elsewhere will automatically allocate digital inputs and outputs as required.


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

DigitalOutput

public DigitalOutput(int slot,
                     int channel)
Create an instance of a digital output. Create an instance of a digital output given a slot and channel.

Parameters:
slot - the slot the digital module is in
channel - the port to use for the digital output

DigitalOutput

public DigitalOutput(int channel)
Create an instance of a digital output. Create a digital output given a channel. The default module is used.

Parameters:
channel - the port to use for the digital output
Method Detail

free

protected void free()
Free the resources associated with a digital output.

Overrides:
free in class SensorBase

set

public void set(boolean value)
Set the value of a digital output.

Parameters:
value - true is on, off is false

pulse

public void pulse(double length)
Output a single pulse on the digital output line. Send a single pulse on the digital output line where the pulse diration is specified in seconds. Maximum pulse length is 0.0016 seconds.

Parameters:
length - The pulselength in seconds

isPulsing

public boolean isPulsing()
Determine if the pulse is still going. Determine if a previously started pulse is still going.

Returns:
true if pulsing

2010 FRC Java API


Copyright © 2006-2009 Sun Microsystems, Inc. All Rights Reserved.