Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
me when branching works (:))
Browse files Browse the repository at this point in the history
  • Loading branch information
cowsed committed Feb 23, 2024
1 parent a927d34 commit 364319e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/vex_project_settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"project": {
"name": "BlueAuto",
"slot": 2,
"slot": 1,
"description": "The cool one",
"platform": "V5",
"creationDate": "Tue, 13 Feb 2024 20:37:40 GMT",
Expand Down
18 changes: 16 additions & 2 deletions src/competition/opcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,32 @@ auto toggle_brake_mode = []() {
* Main entrypoint for the driver control period
*/
void opcontrol() {

vex::timer dont_stop_tmr;
dont_stop_tmr.reset();

con.ButtonRight.pressed([]() { screen::next_page(); });
con.ButtonLeft.pressed([]() { screen::prev_page(); });
//
cata_sys.send_command(CataSys::Command::StartDropping);
// cata_sys.send_command(CataSys::Command::StartDropping);

while (imu.isCalibrating()) {
vexDelay(20);
}

odom.set_position({0, 0, 0});
CommandController cc{
new RepeatUntil(
InOrder{
new DelayCommand(1000),
new Branch(new FunctionCondition(
[]() { return cata_sys.ball_in_intake(); }),
drive_sys.TurnDegreesCmd(-90),
drive_sys.TurnDegreesCmd(90)),
drive_sys.TurnToHeadingCmd(0),
},
new FunctionCondition([]() { return con.ButtonA.pressing(); })),
};
cc.run();
static bool enable_matchload = false;
static std::atomic<bool> disable_drive(false);

Expand Down

0 comments on commit 364319e

Please sign in to comment.