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.
48 lines
976 B
C++
48 lines
976 B
C++
#include "main.h"
|
|
#include "EZ-Template/api.hpp"
|
|
#include "api.h"
|
|
|
|
#pragma once
|
|
|
|
#ifndef CONFIG_H
|
|
#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);
|
|
|
|
/**
|
|
* Declares mechinism motors and motor groups.
|
|
*/
|
|
inline pros::MotorGroup lift({15, -19});
|
|
inline pros::MotorGroup wrist({1, 9});
|
|
inline pros::Motor arm({6});
|
|
|
|
/**
|
|
* Declares piston mechanisms.
|
|
*/
|
|
inline ez::Piston claw({'G',true});
|
|
|
|
/**
|
|
* Declare limit switches and other ADI sensors
|
|
*/
|
|
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});
|
|
|
|
#endif |