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.
54 lines
1.0 KiB
C++
54 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "api.h"
|
|
#include "pros/adi.hpp"
|
|
#include "pros/serial.hpp"
|
|
#include "EZ-Template/piston.hpp"
|
|
|
|
namespace ez {
|
|
/**
|
|
* Enumeration to hold the current part of a match were in.
|
|
*/
|
|
enum class ControlPeriodP {
|
|
driver,
|
|
auton
|
|
};
|
|
/**
|
|
* Enumeration to hold the different controllers avalable.
|
|
*/
|
|
enum class ControllerP {
|
|
master,
|
|
slave
|
|
};
|
|
/**
|
|
* 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{
|
|
|
|
private:
|
|
bool pistonState;
|
|
|
|
public:
|
|
|
|
Pneumatics();
|
|
|
|
void control_piston(enum PistonsP, enum ControlPeriodP, enum ControllerP, enum ButtonsP);
|
|
|
|
bool get_piston_state();
|
|
void set_piston_state(bool value);
|
|
|
|
};
|
|
}; |