Go to Post I would like the game to be called Sanity. Just for irony's sake. - Keri Lynne [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 06-02-2012, 17:11
nuru nuru is offline
Registered User
FRC #4404
 
Join Date: Jan 2012
Location: missouri
Posts: 4
nuru is an unknown quantity at this point
help for code to run motor

We are a rookie team and we wrote the following code to operate the motor.
We are not sure if it will work. Please help.

public class ParkwayRobot extends SimpleRobot
{
private final int PORT_ONE = 1;
private final int PORT_TWO = 2;
private final int MY_SLOT = 1; // or 2, 3, 4
private final double DESIRED_SPEED = 0.7;

RobotDrive drive = new RobotDrive(1, 2); // motors in ports 1 and 2
Joystick leftJoy = new Joystick(PORT_ONE);
Joystick rightJoy = new Joystick(PORT_TWO);

public void autonomous()
{

Jaguar firstJaguar = new Jaguar(MY_SLOT, PORT_ONE);
firstJaguar.set(DESIRED_SPEED); // between -1.0 and 1.0
}

public void operatorControl()
{

while (isOperatorControl() && isEnabled())
{
Drive.tankDrive(leftJoy, rightJoy);
Timer.delay(0.005);
}
}

}

We are not sure how to compile and run this code using Netbeans. Please help.

Thanks a lot!
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 08:34.

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