[FTC]: Buttons RobotC
I am trying to assign buttons to control a Tetrix DC motor when ever i assign 2 functions to control the same motor say one button forward and one backward the motor coughs and jumps and vibrates moving spastically. I attached the code below, how could i solve this problem?
if(joy2Btn(2) )
{
motor[motorF] = 100;
}
else
{
motor[motorF] = 0;
}
if(joy2Btn(1) )
{
motor[motorF] = -100;
}
else
{
motor[motorF] = 0;
}
__________________
John Fogarty
2010 FTC World Championship Winner & 2013-2014 FRC Orlando Regional Winner
Mentor FRC Team 1102 M'Aiken Magic
"Head Bot Coach" FTC Team 11444 Garnet Squadron
Former Student & Mentor FLL 1102, FTC 1102 & FTC 3864, FRC 1772, FRC 5632
2013 FTC World Championship Guest Speaker
|