Package frclib.output

Class FrcPneumatic

java.lang.Object
frclib.output.FrcPneumatic

public class FrcPneumatic extends Object
This class implements a platform dependent pneumatic object. A pneumatic object consists of a 1 or 2 pneumatic channels for a 1 or 2 valve pneumatic cylinder.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FrcPneumatic(String instanceName, int canId, edu.wpi.first.wpilibj.PneumaticsModuleType moduleType, int extendChannel)
    Constructor: Creates a 1-valve pneumatic.
    FrcPneumatic(String instanceName, int canId, edu.wpi.first.wpilibj.PneumaticsModuleType moduleType, int extendChannel, int retractChannel)
    Constructor: Creates a 2-valve pneumatic.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This methods activates the extend channel.
    void
    extend(boolean on)
    This method sets the extend channel ON or OFF.
    void
    extend(double duration)
    This methods activates the extend channel for the specified duration and deactivates it.
    void
    extend(double delay, double duration)
    This method delays the specified delay time and activates the extend channel for the specified duration.
    int
    get(int bitMask)
    This method gets the states of the pneumatic channels specified in a bit mask.
    This methods checks if the pneumatic cylinder is extended.
    void
    This methods activates the retract channel.
    void
    retract(boolean on)
    This method sets the retract channel ON or OFF.
    void
    retract(double duration)
    This methods activates the retract channel for the specified duration and deactivates it.
    void
    retract(double delay, double duration)
    This method delays the specified delay time and activates the retract channel for the specified duration.
    void
    set(int bitMask, boolean on)
    This method sets the state of the pneumatic channels specified in a bit mask.
    This method returns the instance name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FrcPneumatic

      public FrcPneumatic(String instanceName, int canId, edu.wpi.first.wpilibj.PneumaticsModuleType moduleType, int extendChannel)
      Constructor: Creates a 1-valve pneumatic.
      Parameters:
      instanceName - specifies the instance name.
      canId - specifies the CAN ID of the Pneumatics Control Module.
      moduleType - specifies the module type to use.
      extendChannel - specifies the pneumatic channel to extend the cylinder.
    • FrcPneumatic

      public FrcPneumatic(String instanceName, int canId, edu.wpi.first.wpilibj.PneumaticsModuleType moduleType, int extendChannel, int retractChannel)
      Constructor: Creates a 2-valve pneumatic.
      Parameters:
      instanceName - specifies the instance name.
      canId - specifies the CAN ID of the Pneumatics Control Module.
      moduleType - specifies the module type to use.
      extendChannel - specifies the pneumatic channel to extend the cylinder.
      extendChannel - specifies the pneumatic channel to retract the cylinder.
  • Method Details

    • toString

      public String toString()
      This method returns the instance name.
      Overrides:
      toString in class Object
      Returns:
      instance name.
    • set

      public void set(int bitMask, boolean on)
      This method sets the state of the pneumatic channels specified in a bit mask.
      Parameters:
      bitMask - specifies the bit mask of the pneumatic channels to be set.
      on - specifies true to set the channels ON and false to set them OFF.
    • get

      public int get(int bitMask)
      This method gets the states of the pneumatic channels specified in a bit mask.
      Parameters:
      bitMask - specifies the channels to get the states.
      Returns:
      channel states in a bit mask (0: inactive, 1 active).
    • isExtended

      public Boolean isExtended()
      This methods checks if the pneumatic cylinder is extended.
      Returns:
      true if extended, false if not, null if unknown.
    • extend

      public void extend(boolean on)
      This method sets the extend channel ON or OFF.
      Parameters:
      on - specifies true to turn the channel on, false to turn it off.
    • extend

      public void extend()
      This methods activates the extend channel.
    • extend

      public void extend(double duration)
      This methods activates the extend channel for the specified duration and deactivates it.
      Parameters:
      duration - specifies the duration in seconds (from 0.01 to 2.55 sec).
    • extend

      public void extend(double delay, double duration)
      This method delays the specified delay time and activates the extend channel for the specified duration.
      Parameters:
      delay - specifies the delay time in seconds.
      duration - specifies the activation duration in seconds (from 0.01 to 2.55 sec), set to 0.0 if no deactivation required.
    • retract

      public void retract(boolean on)
      This method sets the retract channel ON or OFF.
      Parameters:
      on - specifies true to turn the channel on, false to turn it off.
    • retract

      public void retract()
      This methods activates the retract channel.
    • retract

      public void retract(double duration)
      This methods activates the retract channel for the specified duration and deactivates it.
      Parameters:
      duration - specifies the duration in seconds (from 0.01 to 2.55 sec).
    • retract

      public void retract(double delay, double duration)
      This method delays the specified delay time and activates the retract channel for the specified duration.
      Parameters:
      delay - specifies the delay time in seconds.
      duration - specifies the activation duration in seconds (from 0.01 to 2.55 sec), set to 0.0 if no deactivation required.