I’m new to programming and I’m trying to program a robot right now and it doesn’t seem to be working. it says there are no errors in the programming, so what did I do wrong? Or is it the motors?
Here’s the code-
#pragma config(Motor, port2, FlipA, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, WheelR, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, WheelL, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(true)
{
motor[port2] = vexRT[Btn6U];
motor[port2] = vexRT[Btn6D];
motor[port3] = vexRT[Ch2];
motor[port4] = vexRT[Ch3];
if(vexRT[Ch3] == 1) //Forwards
{
motor[WheelL] = 127;
motor[WheelR] = 127;
}
else
{
motor[WheelL] = 0;
motor[WheelR] = 0;
}
if(vexRT[Ch3] == 1) //Backwards
{
motor[WheelL] = -127;
motor[WheelR] = -127;
}
else
{
motor[WheelL] = 0;
motor[WheelR] = 0;
}
if(vexRT[Ch1] == 1) //Left
{
motor[WheelL] = -127;
motor[WheelR] = 127;
}
else if(vexRT[Ch1] ==1)
{
motor[WheelL] = 0;
motor[WheelR] = 0;
}
if(vexRT[Ch1] == 1)//right
{
motor[WheelL] = 127;
motor[WheelR] = -127;
}
else
motor[WheelL] = 0;
motor[WheelR] = 0;
}
//Split between Wheels/Arm
if(vexRT[Btn6U] == 1) //Up
{
motor[FlipA] = 127;
}
else
{
motor[FlipA] = 0;
}
}