|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Stateful 3-wire pneumatic piston with toggle helpers. More...
#include <piston.hpp>
Public Member Functions | |
| Piston (int input_port, bool default_state=false) | |
| Piston constructor. | |
| Piston (int input_port, int expander_smart_port, bool default_state=false) | |
| Piston constructor in 3 wire expander. | |
| void | set (bool input) |
| Sets the piston to the input. | |
| bool | get () |
| Returns current piston state. | |
| void | button_toggle (int toggle) |
| One button toggle for the piston. | |
| void | buttons (int active, int deactive) |
| Two-button trigger: one button extends, the other retracts. | |
Public Attributes | |
| pros::adi::DigitalOut | piston |
| Underlying PROS digital output. | |
Stateful 3-wire pneumatic piston with toggle helpers.
Wraps a pros::adi::DigitalOut and remembers whether the piston is currently extended. Use button_toggle() for one-button toggling or buttons() for two-button extend/retract.
Definition at line 26 of file piston.hpp.
| light::Piston::Piston | ( | int | input_port, |
| bool | default_state = false |
||
| ) |
Piston constructor.
The starting position of your piston defaults to false.
| input_port | the ports of your pistons |
| default_state | starting state of your piston |
| light::Piston::Piston | ( | int | input_port, |
| int | expander_smart_port, | ||
| bool | default_state = false |
||
| ) |
Piston constructor in 3 wire expander.
The starting position of your piston defaults to false.
| input_ports | the ports of your pistons |
| default_state | starting state of your piston |
| void light::Piston::button_toggle | ( | int | toggle | ) |
One button toggle for the piston.
| toggle | an input button |
| void light::Piston::buttons | ( | int | active, |
| int | deactive | ||
| ) |
Two-button trigger: one button extends, the other retracts.
| active | button id that sets the piston to true |
| deactive | button id that sets the piston to false |
| bool light::Piston::get | ( | ) |
Returns current piston state.
| void light::Piston::set | ( | bool | input | ) |
Sets the piston to the input.
| input | true sets to the opposite of the starting position |
| pros::adi::DigitalOut light::Piston::piston |