1516X High Stakes 2.0
Codebase for 1516X High Stakes season
Loading...
Searching...
No Matches
intake.cpp
Go to the documentation of this file.
1#include "robot/intake.h"
2
3#include "globals.h"
4
5#define SLOWER_VELOCITY 200
6#define FASTER_VELOCITY 600
7
8using namespace Robot;
9using namespace Robot::Globals;
10
12 elevated = false;
13 alliance_color = false;
14}
15
17
18 if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_R1)) {
19 IntakeMotor.move_velocity(-FASTER_VELOCITY);
20 HookMotor.move_velocity(-SLOWER_VELOCITY);
21 } else if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_L1)) {
22 IntakeMotor.move_velocity(FASTER_VELOCITY);
23 HookMotor.move_velocity(SLOWER_VELOCITY);
24 } else {
25 IntakeMotor.brake();
26 HookMotor.brake();
27 }
28}
29
31
32// Vision sensor only works with intake, therefore it should not on
void checkStop()
Checks whether the intake should stop to skip the ring depending on color. It is the embodiment of vi...
Definition intake.cpp:33
void toggle()
Toggles intake elevation.
Definition intake.cpp:30
bool alliance_color
blue is false, red is true.
Definition intake.h:37
void run()
Runs the main function of the intake system.
Definition intake.cpp:16
bool elevated
Definition intake.h:32
#define FASTER_VELOCITY
Definition intake.cpp:6
#define SLOWER_VELOCITY
Definition intake.cpp:5
pros::Motor HookMotor(-2, pros::v5::MotorGears::green, pros::v5::MotorUnits::degrees)
pros::Motor IntakeMotor(-1, pros::v5::MotorGears::blue, pros::v5::MotorUnits::degrees)
pros::Controller controller(pros::E_CONTROLLER_MASTER)
Definition auton.h:8