Skip to content

Commit 0933bc6

Browse files
committed
Fixes SampleRobot template
1 parent 9711a76 commit 0933bc6

File tree

1 file changed

+4
-5
lines changed
  • Templates/CSharp/Project-Templates/SampleRobot

1 file changed

+4
-5
lines changed

Templates/CSharp/Project-Templates/SampleRobot/Robot.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
4-
$endif$
5-
using WPILib;
4+
$endif$using WPILib;
65

76
namespace $safeprojectname$
87
{
@@ -35,7 +34,7 @@ public class $safeprojectname$ : SampleRobot
3534
*/
3635
public override void Autonomous()
3736
{
38-
myRobot.SetSafetyEnabled(false);
37+
myRobot.SafetyEnabled = false;
3938
myRobot.Drive(-0.5, 0.0); // drive forwards half speed
4039
Timer.Delay(2.0); // for 2 seconds
4140
myRobot.Drive(0.0, 0.0); // stop robot
@@ -45,8 +44,8 @@ public override void Autonomous()
4544
* Runs the motors with arcade steering.
4645
*/
4746
public override void OperatorControl() {
48-
myRobot.SetSafetyEnabled(true);
49-
while (IsOperatorControl() && IsEnabled()) {
47+
myRobot.SafetyEnabled = true;
48+
while (IsOperatorControl && IsEnabled) {
5049
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
5150
Timer.Delay(0.005); // wait for a motor update time
5251
}

0 commit comments

Comments
 (0)