Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Victor controls (http://www.chiefdelphi.com/forums/showthread.php?t=89972)

Zuelu562 24-01-2011 17:52

Victor controls
 
I'm attempting to make drive code for our robot currently. We are planning to have our main drive run on a tank control, and our side drive mechanism run on the x-axis of the right hand stick after the right hand stick's trigger has been activated.

We're planning to use a victor for the side drive (a single motor). Would you use the Set method to run it or can you even control a victor via control if it's not a RobotDrive declaration? Relevant current code below.

TY in advance.

Code:

class RobotDemo : public SimpleRobot
{
        RobotDrive maindrive; // main drive system
        Victor crab; // sideways drive system
        Joystick stickone; // right joystick
        Joystick sticktwo; // left joystick

public:
        RobotDemo(void):
                // These must be initialized in the same order
                // as they are declared above.
                maindrive(1, 2),       
                crab(3),
                stickone(1),       
                sticktwo(2)

if (stickone.GetTrigger())
                        {
                                crab.Set(stickone.GetX);
                        }


nighterfighter 24-01-2011 18:28

Re: Victor controls
 
Yes, you can use Set(), even if it is not part of your drive system.

Also, make sure you include that code in your teleop loop.

crab.Set(stickone.GetX()) <- And include a () after GetX

Zuelu562 24-01-2011 18:58

Re: Victor controls
 
Thanks, i forgot the parenthesis.


All times are GMT -5. The time now is 13:38.

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