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);
}