From 8a70ae0f60c318cb05ba566308f07964f89d3f6b Mon Sep 17 00:00:00 2001 From: ion098 <146852218+ion098@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:53:33 +0000 Subject: [PATCH] style: :art: Fix formatting in main.cpp --- src/main.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ab94d8b..30d56e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,17 +75,16 @@ void autonomous() {} * task, not resume it from where it left off. */ void opcontrol() { - - pros::MotorGroup left_mg({1, -2, 3}); // Creates a motor group with forwards ports 1 & 3 and reversed port 2 - pros::MotorGroup right_mg({-4, 5, -6}); // Creates a motor group with forwards port 4 and reversed ports 4 & 6 + pros::MotorGroup left_mg({1, -2, 3}); // Creates a motor group with forwards ports 1 & 3 and reversed port 2 + pros::MotorGroup right_mg({-4, 5, -6}); // Creates a motor group with forwards port 4 and reversed ports 4 & 6 - while (true) { - Gamepad::master.update(); - // Arcade control scheme - int dir = Gamepad::master.LeftY; // Gets amount forward/backward from left joystick - int turn = Gamepad::master.RightX; // Gets the turn left/right from right joystick - left_mg.move(dir - turn); // Sets left motor voltage - right_mg.move(dir + turn); // Sets right motor voltage - pros::delay(20); // Run for 20 ms then update - } + while (true) { + Gamepad::master.update(); + // Arcade control scheme + int dir = Gamepad::master.LeftY; // Gets amount forward/backward from left joystick + int turn = Gamepad::master.RightX; // Gets the turn left/right from right joystick + left_mg.move(dir - turn); // Sets left motor voltage + right_mg.move(dir + turn); // Sets right motor voltage + pros::delay(25); // Run for 25 ms then update + } } \ No newline at end of file