Go to Post You don't want down time during build, eh? - dtengineering [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-04-2013, 02:00
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Stop Driving

Quote:
Originally Posted by ekapalka View Post
How about this?
Code:
bool stopp = false;
[...]
if (!stopp)
{
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
    stopp = true;
}
Does this help?
This example will only work if you're using RobotDrive, have its safety feature enabled, and have the timeout set low enough. Otherwise, it'll just stop changing the motors' speeds instead of actually stopping them.
__________________
I code stuff.
Reply With Quote
  #2   Spotlight this post!  
Unread 06-04-2013, 10:20
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Stop Driving

Is the safety feature enabled by default?
Reply With Quote
  #3   Spotlight this post!  
Unread 06-04-2013, 13:51
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Stop Driving

?
Code:
bool stopp = false;
[...]
if (!stopp)
{
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
    stopp = true;
    DriveTrain.tankDrive(0.0, 0.0);
}
Sorry. I've actually been programming in C++. This year we had a function using something like this that would take control from the driver and autonomously take control using the sensors. It was flawless (we programmed it during the final three rounds of the competition :P )
Reply With Quote
Reply


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 12:48.

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