Log in

View Full Version : Victor controls


Zuelu562
24-01-2011, 17:52
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.


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
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
Thanks, i forgot the parenthesis.