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.
 
void checkStop ()
 Checks whether the intake should stop to skip the ring depending on color. It is the embodiment of vision sensor usage in this codebase.
 
 Intake ()
 
void toggle ()
 Toggles intake elevation.
 

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 11 of file intake.cpp.

11 {
12 elevated = false;
13 alliance_color = false;
14}
bool alliance_color
blue is false, red is true.
Definition intake.h:37
bool elevated
Definition intake.h:32

References alliance_color, and elevated.

Member Function Documentation

◆ checkStop()

void Intake::checkStop ( )

Checks whether the intake should stop to skip the ring depending on color. It is the embodiment of vision sensor usage in this codebase.

Definition at line 33 of file intake.cpp.

33{}

◆ 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 16 of file intake.cpp.

16 {
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}
#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)

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

◆ toggle()

void Intake::toggle ( )

Toggles intake elevation.

Definition at line 30 of file intake.cpp.

30{ elevated = !elevated; }

References elevated.

Member Data Documentation

◆ alliance_color

bool Robot::Intake::alliance_color
private

blue is false, red is true.

Definition at line 37 of file intake.h.

Referenced by Intake().

◆ elevated

bool Robot::Intake::elevated
private

Definition at line 32 of file intake.h.

Referenced by Intake(), and toggle().


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