
Twiching FTC robot problems
We've been trying to program our robot to move so far our code is:
#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, PIDControl)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c"
task main()
{
while (true)
{
getJoystickSettings(joystick);
motor[motorD] = joystick.joy1_y1;
if (joy1Btn(6))
{
motor[motorD] = -50;
}
else
{
motor[motorD] = 0;
}
}
}
The only reason it's -50 is because the motor runs backwards if we have it as 50 it runs backwards. Our main problem is if we try to add a second part to make the wheel's go backwards, or the other wheen in that case, it starts twiching when we press the the button. The code I posted works, but it only goes the one way. We want it preferable to go both ways on both wheels in stead of 1 way on one wheel, or get the joysticks driving it instead of buttons. No one on our team really knows how to program. So if anyone can help, that would be great
