Go to Post I don't think [Amanda] will have any trouble with Needel or the Kelsos but... I can understand Grady and we do have visible evidence of the menace that is Jessica Boucher. (just ask Billfred) - Al Skierkiewicz [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
  #5   Spotlight this post!  
Unread 08-03-2012, 17:53
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Need Serious help !!!!

Quote:
Originally Posted by Team1605 View Post
Thank you and do you have any idea y the robot won't respond ???
Yes, because your code runs once, you need it to loop around constantly looking at the updated values of the joysticks like I posted above. Your operatorControl method should look like this (additions in bold):

Code:
/**
* This function is called once each time the robot enters operator control.
*/
public void operatorControl() {
while(isOperatorControl() && isEnabled())
{
robotDrive.tankDrive(stickDriverLeft.getAxis(AxisT ype.kY), stickDriverRight.getAxis(AxisType.kY));


if(stickDriverRight.getRawButton(TRIGGER_NUMBER)) {
shooter.set(1);
}
else {
shooter.set(0);
}


if(stickDriverRight.getRawButton(GATHER_START_BUTT ON)) {
gatherer.set(1);
}
else if(stickDriverRight.getRawButton(GATHER_STOP_BUTTO N)) {
gatherer.set(0);
}
Timer.delay(.01);
}
}
You will also need to add an import:
import edu.wpi.first.wpilibj.Timer;

That will make your code loop every 10 ms.
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 11:41.

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