Second I finished all the color sorter code, like finishing the function to call when you want to look for a color. Next we had the scotts county competition so I made custom auton routes for us to run at the competition. These will be changed later.
69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "api.h"
|
|
#include "pros/adi.hpp"
|
|
#include "pros/motors.hpp"
|
|
#include "pros/motor_group.hpp"
|
|
|
|
namespace ez {
|
|
/**
|
|
* Enumeration to hold the current part of a match were in.
|
|
*/
|
|
enum class ControlPeriodM {
|
|
driver,
|
|
auton
|
|
};
|
|
/**
|
|
* Enumeration to hold the different controllers avalable.
|
|
*/
|
|
enum class ControllerM {
|
|
master,
|
|
slave
|
|
};
|
|
/**
|
|
* Enumeration to hold the different buttons to use.
|
|
*/
|
|
enum class ButtonsM {
|
|
arrow_buttons,
|
|
Y_B_buttons,
|
|
left_shoulder_buttons,
|
|
right_shoulder_buttons
|
|
};
|
|
/**
|
|
* Enumeration to hold all the motors and motor groups available
|
|
*/
|
|
enum class MotorGroups {
|
|
lift_MG,
|
|
claw_M,
|
|
roller_M
|
|
};
|
|
/**
|
|
* Motor mechanism class
|
|
*/
|
|
class Mechanisms {
|
|
private:
|
|
|
|
public:
|
|
float fw_motor_speed = 0;
|
|
float rev_motor_speed = 0;
|
|
|
|
/**
|
|
* Default constructor
|
|
*/
|
|
Mechanisms();
|
|
|
|
/**
|
|
* Allows you to control your motors
|
|
*
|
|
* \param controlPeriodM
|
|
* The current control period were in
|
|
*
|
|
*
|
|
*/
|
|
void motor_control(enum ControlPeriodM, enum ControllerM, enum ButtonsM, enum MotorGroups, float fw_motor_speed, float rev_motor_speed);
|
|
|
|
float get_motor_speed();
|
|
float set_motor_speed(float value);
|
|
|
|
};
|
|
}; |