mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Improved Command-based examples (#906)
Robot.cpp has been split into header-source pairs and the Command-based examples now define an example subsystem in the Robot class.
This commit is contained in:
committed by
Peter Johnson
parent
14228d82f3
commit
96e9a6989c
@@ -23,8 +23,7 @@ import edu.wpi.first.wpilibj.templates.commandbased.subsystems.ExampleSubsystem;
|
||||
* project.
|
||||
*/
|
||||
public class Robot extends TimedRobot {
|
||||
public static final ExampleSubsystem kExampleSubsystem
|
||||
= new ExampleSubsystem();
|
||||
public static ExampleSubsystem m_subsystem = new ExampleSubsystem();
|
||||
public static OI m_oi;
|
||||
|
||||
Command m_autonomousCommand;
|
||||
|
||||
@@ -16,7 +16,7 @@ import edu.wpi.first.wpilibj.templates.commandbased.Robot;
|
||||
public class ExampleCommand extends Command {
|
||||
public ExampleCommand() {
|
||||
// Use requires() here to declare subsystem dependencies
|
||||
requires(Robot.kExampleSubsystem);
|
||||
requires(Robot.m_subsystem);
|
||||
}
|
||||
|
||||
// Called just before this Command runs the first time
|
||||
|
||||
Reference in New Issue
Block a user