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#include "lemlib/timer.hpp"
5#include "pros/misc.h"
6#include "robot/ladybrown.h"
7#include "pros/rtos.hpp"
8
9#define SLOWER_VELOCITY 200
10#define FASTER_VELOCITY 600
11
12using namespace Robot;
13using namespace Robot::Globals;
14
16
17lemlib::PID crap_pid(0.3, 0, 0.5, 3, false);
18
20
21
22
24
25 if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_R1)) {
26 IntakeMotor.move_velocity(-FASTER_VELOCITY);
27 HookMotor.move_velocity(-SLOWER_VELOCITY);
28 } else if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_L1)) {
29 IntakeMotor.move_velocity(FASTER_VELOCITY);
30 HookMotor.move_velocity(SLOWER_VELOCITY);
31
32 // if (HookSwitch.get_value() == 1) {
33 // int target = HookRotation.get_position();
34 // while (HookSwitch.get_value() == 1) {
35 // HookMotor.move_velocity(75);
36 // target = HookRotation.get_position() + 16500;
37 // pros::delay(5);
38 // }
39
40 // while (HookRotation.get_position() % 83400 > 41700) {
41 // pros::delay(5);
42 // }
43 // pros::Task move([&]() { ladybrown.MoveToPoint(LadyBrown::ATTACK_STATE); }, "LadyBrownMove");
44
45
46 // HookMotor.move_velocity(-200);
47 // IntakeMotor.move_velocity(0);
48
49 // }
50
51 } else {
52 IntakeMotor.brake();
53 HookMotor.brake();
54 }
55
56
57 if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_RIGHT)) {
58 IntakeMotor.move_velocity(FASTER_VELOCITY);
59 } else if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_DOWN)) {
60 IntakeMotor.move_velocity(-FASTER_VELOCITY);
61 }
62
63 if (controller.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_A)) {
64 IntakeLift.toggle();
65 }
66}
bool alliance_color
blue is false, red is true.
Definition intake.h:26
void run()
Runs the main function of the intake system.
Definition intake.cpp:23
The LadyBrown class represents the robot lady brown subsystem.
Definition ladybrown.h:9
Robot::LadyBrown ladybrown
Definition intake.cpp:19
#define FASTER_VELOCITY
Definition intake.cpp:10
lemlib::PID crap_pid(0.3, 0, 0.5, 3, false)
#define SLOWER_VELOCITY
Definition intake.cpp:9
pros::Motor IntakeMotor(-4, pros::v5::MotorGears::blue, pros::v5::MotorUnits::degrees)
pros::Motor HookMotor(3, pros::v5::MotorGears::green, pros::v5::MotorUnits::degrees)
pros::adi::Pneumatics IntakeLift('D', false)
pros::Controller controller(pros::E_CONTROLLER_MASTER)
Definition auton.h:10