File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,29 +31,27 @@ In this section we will be going over
3131## Creating a basic Autonomous Command
3232
3333!!! summary ""
34- ** 1)** Create a new command called ** Autonomous**
35-
36-
37- <details><summary>example</summary>
38- package frc.robot.commands;
39-
40- import edu.wpi.first.wpilibj.Timer;
41- import edu.wpi.first.wpilibj2.command.Command;
42- import frc.robot.subsystems.CANDriveSubsystem;
43-
44- // Command to run the robot at 1/2 power for 1 second in autonomous
45- public class AutoCommand extends Command {
46-
47- }
48- <deatils>
34+ ** 1)** Create a new command called ** AutoCommand** using the ` create new class/command ` feature in Vscode.
35+
4936
5037!!! summary ""
5138 ** 2)** Before the constructor create a ** double** called ** distance**
39+ ```Java
40+ private Double distance;
41+ ```
5242
5343 - We will use this to tell the command to finish when the robot drives the inputted distance
44+
45+ **3)** Also create a **Timer** called `runtime`.
46+
47+ ```Java
48+ private Time runTime;
49+ ```
50+
51+ - This will be used to control how long the robot will move for.
5452
5553!!! summary ""
56- ** 3)** In the ** DriveDistance ** constructor add a ** double ** parameter called ** inches **
54+ ** 3)** In the ** AutoCommand ** constructor add a ** DriveSubsystem ** parameter called ** driveSubsystem **
5755
5856!!! summary ""
5957 ** 4)** Inside type:
You can’t perform that action at this time.
0 commit comments