CommandController

class CommandController : public pros::Controller

Command Controller overrides pros::Controller and makes it better interface with Trigger and command based code.

// Initialize CommandController
CommandController primary(pros::E_CONTROLLER_MASTER);

Command *command;

// Register trigger to toggle command on pressing DIGITAL_R2
primary.getTrigger(DIGITAL_R2)->toggleOnTrue(command);

Public Functions

inline explicit CommandController(const pros::controller_id_e_t id)

Construct a new CommandController.

Parameters:

id – Master, Partner controller ID

inline Trigger *getTrigger(pros::controller_digital_e_t button)

Create trigger from button.

Parameters:

button – The button to create a Trigger on

Returns:

Trigger with the boolean as the desired button