Fixed a problem where the OPControl was trying to pull values from an array that never had any values to begin with

causeing a segmentation fault and crashing the brain.
Also changed how the function lift_range_finder worked.  Instead of just makeing a variable eqaul to a number it also returns the value
so we can use it outside of the function.
We also added actual values to all the arrays.
This commit is contained in:
Carter committed 2026-09-09 13:29:07 -04:00
1 parent c46a581eb1
commit 24ee947fd5
8 files changed
+340 -192

No files matched your search

+19 -8
View File
@@ -6,24 +6,35 @@
#include "EZ-Template/piston.hpp"
namespace ez {
enum class Pistons {
claw_piston
};
enum class ControlPeriod {
/**
* Enumeration to hold the current part of a match were in.
*/
enum class ControlPeriodP {
driver,
auton
};
enum class Controller {
/**
* Enumeration to hold the different controllers avalable.
*/
enum class ControllerP {
master,
slave
};
enum class Buttons {
/**
* Enumeration to hold the different buttons to use.
*/
enum class ButtonsP {
arrow_buttons,
Y_B_buttons,
left_shoulder_buttons,
right_shoulder_buttons
};
/**
* Enumeration to hold all the pistons avalable.
*/
enum class PistonsP {
claw_piston
};
class Pneumatics{
@@ -34,7 +45,7 @@ namespace ez {
Pneumatics();
void control_piston(enum Pistons, enum ControlPeriod, enum Controller, enum Buttons);
void control_piston(enum PistonsP, enum ControlPeriodP, enum ControllerP, enum ButtonsP);
bool get_piston_state();
void set_piston_state(bool value);