Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Commit

Permalink
Final code that was on the robot at competition
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley Chalmers committed Dec 16, 2018
1 parent bfff84a commit 40c5e6a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
Binary file modified bin/_pros_ld_timestamp.o
Binary file not shown.
Binary file modified bin/autonomous.cpp.o
Binary file not shown.
Binary file modified bin/functions.cpp.o
Binary file not shown.
Binary file modified bin/output.bin
Binary file not shown.
Binary file modified bin/output.elf
Binary file not shown.
2 changes: 1 addition & 1 deletion include/ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define INTAKE 5
#define INTAKE_REVERSED true
#define INTAKE_SPEED 64 // throttle the speed to prevent ball overshoot
#define INTAKE_SPEED 96 // throttle the speed to prevent ball overshoot

#define ARM 6

Expand Down
9 changes: 6 additions & 3 deletions src/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ extern pros::Controller controller;
*/

void autonomous() {
//ok.moveDistance(12_in);
//ok.turnAngle(90_deg);
delay(10);
drivetrain.drive(127, 127);
delay(4000);
drivetrain.drive(0, 0);
while (true) {
delay(10);
}
}
8 changes: 5 additions & 3 deletions src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ void Intake::handle() {
intakeSpinning = !intakeSpinning;
}
if (controller.get_digital(REVERSE_INTAKE)) {
motor.move(-127);
motor.move(-INTAKE_SPEED);
} else if (intakeSpinning) {
motor.move(127);
motor.move(INTAKE_SPEED);
} else {
motor.move(0);
}
Expand All @@ -31,12 +31,14 @@ void Intake::spin(int direction) {
}

void Puncher::handle() {
motor.set_brake_mode(E_MOTOR_BRAKE_HOLD);
if (controller.get_digital(FORWARD_PUNCHER)) {
motor.move(127);
} else if (controller.get_digital(REVERSE_PUNCHER)) {
motor.move(-127);
} else {
motor.move(0);
//motor.move(0);
motor.move_absolute(motor.get_position(), 127); // hold in place
}
}

Expand Down

0 comments on commit 40c5e6a

Please sign in to comment.