Skip to content

Commit

Permalink
idk but this breaks it
Browse files Browse the repository at this point in the history
  • Loading branch information
PA055 committed Sep 10, 2024
1 parent 8395b9b commit d5b226a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ void leftLongPress1() { printf("Left Long Press!\n"); }
void leftShortRelease1() { printf("Left Short Release!\n"); }

void initialize() {
// We can register functions to run when buttons are pressed
Gamepad::master.Down.onPress("downPress1", downPress1);
// ...or when they're released
Gamepad::master.Up.onRelease("downRelease1", upRelease1);
// There's also the longPress event
Gamepad::master.Left.onLongPress("leftLongPress1", leftLongPress1);
// We can have two functions on one button,
// just remember to give them different names
Gamepad::master.Left.onShortRelease("leftShortRelease", leftShortRelease1);
// And we can use lambda's too
Gamepad::master.X.onShortRelease("xShortRelease1", []() { printf("X Short Release!\n"); });
// // We can register functions to run when buttons are pressed
// Gamepad::master.Down.onPress("downPress1", downPress1);
// // ...or when they're released
// Gamepad::master.Up.onRelease("downRelease1", upRelease1);
// // There's also the longPress event
// Gamepad::master.Left.onLongPress("leftLongPress1", leftLongPress1);
// // We can have two functions on one button,
// // just remember to give them different names
// Gamepad::master.Left.onShortRelease("leftShortRelease", leftShortRelease1);
// // And we can use lambda's too
// Gamepad::master.X.onShortRelease("xShortRelease1", []() { printf("X Short Release!\n"); });
}

/**
Expand Down Expand Up @@ -77,8 +77,8 @@ 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) {
// Remember to ALWAYS call update at the start of your while loop!
Expand All @@ -87,10 +87,10 @@ void opcontrol() {
Gamepad::master.print_line(0, "hello\n\nhi");

// We'll use the 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
// 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); // Wait for 25 ms, then update the motor values again
}
Expand Down

0 comments on commit d5b226a

Please sign in to comment.