So I’m trying to make a X-drive in Vex-Iq and I was wondering how to program it (custom) for driving. The main problem is how to make it strafe in any direction.
Here you go, the best holonomic tutorial out there.
6 Likes
Here’s the code to my Mini X-drive.
#pragma config(Sensor, port2, bckl, sensorVexIQ_LED)
#pragma config(Sensor, port12, frol, sensorVexIQ_LED)
#pragma config(Motor, motor1, ld, tmotorVexIQ, PIDControl, driveLeft, encoder)
#pragma config(Motor, motor4, side, tmotorVexIQ, PIDControl, encoder)
#pragma config(Motor, motor6, rd, tmotorVexIQ, PIDControl, reversed, driveRight, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
repeat(forever)
{
setMotor(rd,getJoystickValue(ChD));
setMotor(ld,getJoystickValue(ChA));
setTouchLEDHue(frol, getJoystickValue(ChD));
setTouchLEDHue(bckl, getJoystickValue(ChA));
if (getJoystickValue(BtnRUp))
{
setMotor(side, 100);
}
else
{
if (getJoystickValue(BtnRDown))
{
setMotor(side, -100);
}
else
{
stopMotor(side);
}
if (getJoystickValue(ChD)== 0)
{
setTouchLEDColor(frol, colorBlue);
}
else
{
if (getJoystickValue(ChA)== 0)
{
setTouchLEDColor(bckl, colorViolet);
}
}
}
}
}