Skip to content

Commit

Permalink
added straight drive test menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkamprath committed Sep 30, 2024
1 parent a4414e5 commit cedc10a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,12 @@ impl<
// - button one will select the current function and execute it
// - if no button is pressed for the idle wait time, return to idle state

const FUNCTIONS: [&str; 3] = ["Select Path", "Calibrate Gyro", "Heading Display"];
const FUNCTIONS: [&str; 4] = [
"Select Path",
"Calibrate Gyro",
"Heading Display",
"Drive Straight",
];
let mut function_idx: usize = 0;
let mut last_interaction_millis = millis();
self.robot.clear_display_reset_timer();
Expand Down Expand Up @@ -272,6 +277,10 @@ impl<
self.robot.display_heading().ok();
self.robot.set_display_to_idle();
}
3 => {
self.robot.straight(1500, true);
self.robot.start_display_reset_timer();
}
_ => {
warn!("handle_functions_menu: invalid function index");
}
Expand Down

0 comments on commit cedc10a

Please sign in to comment.