Solenoid class for running high voltage Digital Output on a pneumatics module.
More...
#include <frc/Solenoid.h>
Solenoid class for running high voltage Digital Output on a pneumatics module.
The Solenoid class is typically used for pneumatics solenoids, but could be used for any device within the current spec of the module.
◆ Solenoid() [1/3]
Constructs a solenoid for a specified module and type.
- Parameters
-
module | The module ID to use. |
moduleType | The module type to use. |
channel | The channel the solenoid is on. |
◆ Solenoid() [2/3]
Constructs a solenoid for a default module and specified type.
- Parameters
-
moduleType | The module type to use. |
channel | The channel the solenoid is on. |
◆ ~Solenoid()
frc::Solenoid::~Solenoid |
( |
| ) |
|
|
override |
◆ Solenoid() [3/3]
◆ Get()
virtual bool frc::Solenoid::Get |
( |
| ) |
const |
|
virtual |
Read the current value of the solenoid.
- Returns
- The current value of the solenoid.
◆ GetChannel()
int frc::Solenoid::GetChannel |
( |
| ) |
const |
Get the channel this solenoid is connected to.
◆ InitSendable()
Initializes this Sendable object.
- Parameters
-
Implements wpi::Sendable.
◆ IsDisabled()
bool frc::Solenoid::IsDisabled |
( |
| ) |
const |
Check if solenoid is Disabled.
If a solenoid is shorted, it is added to the DisabledList and disabled until power cycle, or until faults are cleared.
- See also
- ClearAllPCMStickyFaults()
- Returns
- If solenoid is disabled due to short.
◆ operator=()
◆ Set()
virtual void frc::Solenoid::Set |
( |
bool |
on | ) |
|
|
virtual |
Set the value of a solenoid.
- Parameters
-
on | Turn the solenoid output off or on. |
◆ SetPulseDuration()
void frc::Solenoid::SetPulseDuration |
( |
units::second_t |
duration | ) |
|
Set the pulse duration in the pneumatics module.
This is used in conjunction with the startPulse method to allow the pneumatics module to control the timing of a pulse.
On the PCM, the timing can be controlled in 0.01 second increments, with a maximum of 2.55 seconds. On the PH, the timing can be controlled in 0.001 second increments, with a maximum of 65.534 seconds.
- Parameters
-
duration | The duration of the pulse. |
- See also
- startPulse()
◆ StartPulse()
void frc::Solenoid::StartPulse |
( |
| ) |
|
Trigger the pneumatics module to generate a pulse of the duration set in setPulseDuration.
- See also
- setPulseDuration()
◆ Toggle()
void frc::Solenoid::Toggle |
( |
| ) |
|
Toggle the value of the solenoid.
If the solenoid is set to on, it'll be turned off. If the solenoid is set to off, it'll be turned on.
The documentation for this class was generated from the following file: