1516X Push Back 1.0
1516X's robot code for the 2025-2026 VEX Robotics Competition
Loading...
Searching...
No Matches
main.cpp File Reference
#include "main.h"
#include "command/commandController.h"
#include "command/commandScheduler.h"
#include "robot/globals.h"
#include "robot/intake.h"
#include "units/units.hpp"

Go to the source code of this file.

Functions

CommandController primary (pros::E_CONTROLLER_MASTER)
 
void update_loop ()
 
void initialize ()
 
void disabled ()
 
void competition_initialize ()
 
void autonomous ()
 
void opcontrol ()
 

Variables

Intakeintake
 

Function Documentation

◆ autonomous()

void autonomous ( )

Definition at line 40 of file main.cpp.

40 {
41 // Your autonomous code will go here
42}

◆ competition_initialize()

void competition_initialize ( )

Definition at line 38 of file main.cpp.

38{}

◆ disabled()

void disabled ( )

Definition at line 36 of file main.cpp.

36{}

◆ initialize()

void initialize ( )

Definition at line 23 of file main.cpp.

23 {
24 chassis.calibrate(); // calibrate sensors
25 pros::Task commandSchedulerTask(update_loop);
26 intake = new Intake(pros::Motor(20));
27 CommandScheduler::registerSubsystem(intake, intake->pctCommand(0.0));
28 primary.getTrigger(DIGITAL_L1)->whileTrue(intake->pctCommand(-1.0));
29 primary.getTrigger(DIGITAL_L2)->whileTrue(intake->pctCommand(1.0));
30 primary.getTrigger(DIGITAL_A)->whileTrue(intake->pctCommand(-1.0)
31 ->withTimeout(300_ms)
32 ->andThen(intake->pctCommand(1.0)->withTimeout(300_ms))
33 ->repeatedly());
34}
lemlib::Chassis chassis
CommandController primary(pros::E_CONTROLLER_MASTER)
Intake * intake
Definition main.cpp:12
void update_loop()
Definition main.cpp:15

References chassis, intake, primary(), and update_loop().

◆ opcontrol()

void opcontrol ( )

Definition at line 44 of file main.cpp.

44{}

◆ primary()

CommandController primary ( pros::E_CONTROLLER_MASTER )

Referenced by initialize().

◆ update_loop()

void update_loop ( )

Definition at line 15 of file main.cpp.

15 {
16 while (true) {
17 auto start_time = pros::millis();
18 CommandScheduler::run();
19 pros::c::task_delay_until(&start_time, 10);
20 }
21}

Referenced by initialize().

Variable Documentation

◆ intake

Intake* intake

Definition at line 12 of file main.cpp.

Referenced by initialize().