Go to Post Joe is a great sport and this was a good moral booster after a grueling weekend. How many opportunities do you get to play William Tell with a Regional WFA Winner? :) - The Lucas [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 05-02-2016, 09:57
VrewDaive VrewDaive is offline
Registered User
FRC #4284
 
Join Date: Sep 2015
Location: Cincinnati
Posts: 21
VrewDaive is an unknown quantity at this point
teleop drive changing help

Hey all! Our team is having 2 seperate drives that we want to have change.
The goal is to have one button on the Xbox controller Right now its MoveStick.getRawButton(0) and MoveStick.getRawButton(1).
there's a group of motors, lets call them catcher, catcher1, catcher2.
button 0 should make catcher and catcher1 drive.
button 1 should make catcher1 and catcher 2 drive.
We don't need to control turning or anything so the ".drive"method should work. I wish i had the code with me but its on a computer elsewhere in the building. I hope i was descriptive enough. Thanks!


// i've created drives for each of the two being used they are
RobotDrive front = new RobotDrive(catcher, catcher1);
RobotDrive rear = new RobotDrive(catcher1, catcher2);
Thanks!!
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2016, 11:27
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,171
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: teleop drive changing help

So what's wrong with this type of logic?

If (Button 0 is pressed) {
Drive Catcher;
Drive Catcher1;
}

If (Button 1 is pressed) {
Drive Catcher1;
Drive Catcher2;
}
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2016, 14:08
VrewDaive VrewDaive is offline
Registered User
FRC #4284
 
Join Date: Sep 2015
Location: Cincinnati
Posts: 21
VrewDaive is an unknown quantity at this point
Re: teleop drive changing help

Its not working.... I put it in the code and get all kinds of errors, could you put it in code? what i have now is this
Code:
    public void operatorControl() {
        if(moveStick.getRawButton(0))
        {
            frontCatcher.drive(1,0);
}
        

if(moveStick.getRawButton(1))
{
   backCatcher.drive(1,0);
}
    }
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2016, 06:29
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,171
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: teleop drive changing help

what errors are you getting?

You may want to print messages to the Smart Dashboard so that you know a section of your code is executing.

You may also want to add an Else to set the motor to (0,0) if the button is not pressed.
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 09:12.

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