LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
piston.hpp
Go to the documentation of this file.
1/*
2This Source Code Form is subject to the terms of the Mozilla Public
3License, v. 2.0. If a copy of the MPL was not distributed with this
4file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9#include "LightLib/api.h"
10
18namespace light {
26class Piston {
27 public:
29 pros::adi::DigitalOut piston;
30
41 Piston(int input_port, bool default_state = false);
42
53 Piston(int input_port, int expander_smart_port, bool default_state = false);
54
61 void set(bool input);
62
66 bool get();
67
74 void button_toggle(int toggle);
75
84 void buttons(int active, int deactive);
85
86 private:
87 bool reversed = false;
88 bool current = false;
89 int last_press = 0;
90};
91}; // namespace light
PROS API header provides high-level user functionality.
Stateful 3-wire pneumatic piston with toggle helpers.
Definition piston.hpp:26
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.
bool get()
Returns current piston state.
pros::adi::DigitalOut piston
Underlying PROS digital output.
Definition piston.hpp:29
void set(bool input)
Sets the piston to the input.
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 LightLib odometry / pose-estimation API.
Definition pid.hpp:22