Made a new pneumatics class and implemented it in driver control, also made a few different classes for the rotation sensors. Got all the rotation classes implemented with connection to the physical rotation sensors and the motors. Added another controller to be implemented later.

This commit is contained in:
Carter committed 2026-09-02 20:20:52 -04:00
1 parent bd0e77e240
commit b7af93220d
14 files changed
+452 -101

No files matched your search

+23 -64
View File
@@ -7,73 +7,32 @@
#ifndef CONFIG_H
#define CONFIG_H
extern bool gotRed;
extern bool gotBlue;
extern double currentColor;
/**
*
*/
inline pros::Controller master;
inline pros::Controller slave;
extern Drive chassis;
/**
* Declare mechinism motors
*/
inline pros::MotorGroup lift({10, 11});
inline pros::MotorGroup wrist({13, 14});
inline pros::Motor arm({12});
// Declares the left side motors
extern pros::Motor FrontLeft;
extern pros::Motor MiddleLeft;
extern pros::Motor BackLeft;
/**
* Declare pistons here
*/
inline ez::Piston claw({'A',true});
// Declares the right side motors
extern pros::Motor FrontRight;
extern pros::Motor MiddleRight;
extern pros::Motor BackRight;
/**
* Declare sensors here
*/
inline pros::Rotation liftRotation({15});
inline pros::Rotation armRotation({16});
inline pros::Rotation wristRotatio({17});
// Declares the left and right drive motor groups.
extern pros::MotorGroup RightSide;
extern pros::MotorGroup LeftSide;
// Declares all the drive motors as a group.
extern pros::MotorGroup FullDrive;
// Declaring the Intake motors.
inline pros::Motor stage1({14});
inline pros::Motor stage2({16});
inline pros::Motor stage3({12});
//
inline ez::Piston ramp({'H',true});
// Declaring the piston used to guide the balls into the basket.
inline ez::Piston deScorer({'G',false});
// Declaring the piston used to get the balls out of the tube.
inline ez::Piston matchLoader({'F',false});
//
inline pros::Optical colorSensorOne({20});
inline pros::Optical colorSensorTwo({11});
inline pros::Optical colorSensorThree({18});
//
inline pros::Distance frontDistance({5});
//inline pros::MotorGroup fillingGroup({20, 17, 18});
//inline pros::MotorGroup scoringGroup({20, 17, 18, 19});
// Function used for the Intake control
void IntakePresets();
void ToggleButtons();
// Function used for the color sorter
void ColorDisplay();
void CheckRed(std::string Sensor, std::string controlPeriod, bool loop);
void CheckBlue(std::string Sensor, std::string controlPeriod, bool loop);
void ColorDetection(std::string wantedColor, bool checkForColor);
// Auton voids
void leftMain(std::string side);
void rightMain(std::string side);
void Skills();
void BlueRight();
void BlueLeft();
void RedRight();
void RedLeft();
void testMain(std::string side);
void Test();
inline pros::Optical colorSensorOne({18});
inline pros::Optical colorSensorTwo({19});
#endif