From a style and code neatness standpoint, might I suggest putting your right talons in an array and your left talons in another? Then you can set an entire side's speeds with a for loop like so:
Code:
for (int i = 0; i < left.length; i++)
{
left[i].set(1);
}
or now with the roboRIO (Java SE 8), with a for each loop...
Code:
for (Talon t : left)
t.set(1);
then put it in another method for easy use...
Code:
public void setLeft(int speed)
{
for (Talon t : left)
t.set(speed);
}
or even a more general method for less code...
Code:
public void setSpeed(Talon[] tarray, int Speed)
{
for (Talon t : tarray)
t.set(speed);
}
and finally, work in the inversion...
Code:
public void setSpeed(Talon[] tarray, int Speed)
{
for (Talon t : tarray)
{
if (t.equals(talon1) || t.equals(talon5) || t.equals(talon6))
t.set(-speed);
else
t.set(speed);
}
}
We handle setting our drivetrain speed in a similar fashion.