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

+20 -10
View File
@@ -8,29 +8,39 @@
#define CONFIG_H
/**
*
* Sets up the master and slave controllers.
*/
inline pros::Controller master(pros::E_CONTROLLER_MASTER);
inline pros::Controller slave(pros::E_CONTROLLER_PARTNER);
/**
* Declare mechinism motors
* Declares mechinism motors and motor groups.
*/
inline pros::MotorGroup lift({10, 11});
inline pros::MotorGroup wrist({13, 14});
inline pros::Motor arm({12});
inline pros::MotorGroup lift({15, -19});
inline pros::MotorGroup wrist({1, 9});
inline pros::Motor arm({6});
/**
* Declare pistons here
* Declares piston mechanisms.
*/
inline ez::Piston claw({'G',true});
/**
* Declare sensors here
* Declare limit switches and other ADI sensors
*/
inline pros::Rotation liftRotation({15});
inline pros::Rotation armRotation({16});
inline pros::Rotation wristRotation({17});
inline pros::ADIButton liftReset({'A'});
inline pros::ADIButton armReset({'B'});
/**
* Declares all sensors.
*
* [1] - Rotation sensors
*
* [2] - Color sensors
*/
inline pros::Rotation liftRotation({17});
inline pros::Rotation armRotation({8});
inline pros::Rotation wristRotation({21});
inline pros::Optical colorSensorOne({18});
inline pros::Optical colorSensorTwo({19});