In the big picture there will be a 2-axis joystick controlling two DC motors.
this is simple too. It is only a differential setup.
Pseudocode.
if ( Y > 0 && XL > 0 || XR < 0) //forward with left or right turning
{
M1F = Y - XL; M2F = Y - XR; //XL and XR can be set by an IF statement, if analogRead(A0) > 0, then put it in XL
M1R = 0 or LOW M2R = 0 or LOW // else put it in XR
}
else if ( Y < 0 && XL > 0 || XR < 0) // reverse with left or right turning
{
M1R = Y - XL; M2R = Y - XR;
M1F = 0 or LOW M2F = 0 or LOW
}
More code for 360 turning...
else
{...full stop... }