2010 FRC Java API


edu.wpi.first.wpilibj
Class Solenoid

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

public class Solenoid
extends SensorBase

Solenoid class for running high voltage Digital Output (9472 module). The Solenoid class is typically used for pneumatics solenoids, but could be used for any device within the current spec of the 9472 module.


Field Summary
 
Fields inherited from class edu.wpi.first.wpilibj.SensorBase
kAnalogChannels, kAnalogModules, kChassisSlots, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond
 
Constructor Summary
Solenoid(int channel)
          Constructor.
Solenoid(int slot, int channel)
          Constructor.
 
Method Summary
protected  void free()
          Destructor.
 boolean get()
          Read the current value of the solenoid.
static byte getAll()
          Read the current value of all solenoids.
 void set(boolean on)
          Set the value of a solenoid.
static int slotToIndex(int slot)
          Convert slot number to index.
 
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

Solenoid

public Solenoid(int channel)
Constructor.

Parameters:
channel - The channel on the module to control.

Solenoid

public Solenoid(int slot,
                int channel)
Constructor.

Parameters:
slot - The slot that the 9472 module is plugged into.
channel - The channel on the module to control.
Method Detail

free

protected void free()
Destructor.

Overrides:
free in class SensorBase

slotToIndex

public static int slotToIndex(int slot)
Convert slot number to index.

Parameters:
slot - The slot in the chassis where the module is plugged in.
Returns:
An index to represent the module internally.

set

public void set(boolean on)
Set the value of a solenoid.

Parameters:
on - Turn the solenoid output off or on.

get

public boolean get()
Read the current value of the solenoid.

Returns:
The current value of the solenoid.

getAll

public static byte getAll()
Read the current value of all solenoids.

Returns:
The current value of all solenoids.

2010 FRC Java API


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