1516X High Stakes 2.0
Codebase for 1516X High Stakes season
Loading...
Searching...
No Matches
Robot::Intake Class Reference

The Intake class represents a robot intake system. More...

#include <intake.h>

Public Member Functions

void run ()
 Runs the main function of the intake system.
 
 Intake ()
 

Private Attributes

bool elevated
 
bool alliance_color
 blue is false, red is true.
 

Detailed Description

The Intake class represents a robot intake system.

Definition at line 8 of file intake.h.

Constructor & Destructor Documentation

◆ Intake()

Intake::Intake ( )

Definition at line 15 of file intake.cpp.

15{ alliance_color = false; }
bool alliance_color
blue is false, red is true.
Definition intake.h:26

References alliance_color.

Member Function Documentation

◆ run()

void Intake::run ( )

Runs the main function of the intake system.

Takes optional user input to control the direction of the intake system in autonomous.

Definition at line 23 of file intake.cpp.

23 {
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}
#define FASTER_VELOCITY
Definition intake.cpp:10
#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)

References Robot::Globals::controller(), FASTER_VELOCITY, Robot::Globals::HookMotor(), Robot::Globals::IntakeLift(), Robot::Globals::IntakeMotor(), and SLOWER_VELOCITY.

Member Data Documentation

◆ alliance_color

bool Robot::Intake::alliance_color
private

blue is false, red is true.

Definition at line 26 of file intake.h.

Referenced by Intake().

◆ elevated

bool Robot::Intake::elevated
private

Definition at line 21 of file intake.h.


The documentation for this class was generated from the following files: