Go to Post Hall of Fame FIRST Team 254 has arguably helped more teams become good than any other team in FIRST. I don't think they need a lecture on helping their opponents. - Karthik [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 30-01-2014, 13:39
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: [cRIO] Robot Drive... Output not updated often enough.

Here is the new code:

Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Joystick;
public class RobotTemplate extends SimpleRobot
{
 private RobotDrive drivetrain;
 private Joystick mainStick;
 public RobotTemplate()
 {
 drivetrain = new RobotDrive(1, 2); // create RobotDrive
 mainStick = new Joystick(1); // and joysticks
 }
 public void autonomous() {
 for (int i = 0; i < 4; i++) {
 drivetrain.drive(0.5, 0.0); // drive 50% forward with 0% turn
 Timer.delay(2.0); // wait 2 seconds
 drivetrain.drive(0.0, 0.75); // drive 0% forward and 75% turn
 }
 drivetrain.drive(0.0, 0.0); // drive 0% forward, 0% turn (stop)
 }
 public void OperatorControl()
 {
 while (true && isOperatorControl() && isEnabled())
 {
 drivetrain.arcadeDrive(mainStick);// drive w/joysticks
 Timer.delay(0.02);
 }
 }
}
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi