Hi.
I have deduced the problems on my danny lift to two problems;
-Programming
-2 and 3 wire extension chord(s)
When the motor controller is plugged directly into the cortex, the motors work perfectly. When I take out the motor control out and place the 2 wire extension and put the motor control at the end of that, it doesn’t seem to work. Same goes for the 3 wire extensions, though the extension comes after the motor control.
I am firmly positive it is not my motors because of the reason I stated above, which is that I connected the motor control directly to the cortex and it worked.
As I am the only person in my school that is familiar with robotC I would like you to revise my code in case I’m missing something. Other than that, it might be my motor control wires not playing nice with the extensions
#pragma config(Motor, port2, rightFront, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, leftFront, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, rightBack, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, leftBack, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, rightTop, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port7, leftTop, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, rightBottom, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port9, leftBottom, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)
#include "Vex_Competition_Includes.c"
void pre_auton()
{
bStopTasksBetweenModes = true;
}
task autonomous()
{
AutonomousCodePlaceholderForTesting();
}
task usercontrol()
{
if(vexRT[Btn5U] == 1)
{
motor[rightTop] = 127;
motor[leftTop] = 127;
motor[rightBottom] = 127;
motor[leftBottom] = 127;
}
else if(vexRT[Btn5D] == 1)
{
motor[rightTop] = -127;
motor[leftTop] = -127;
motor[rightBottom] = -127;
motor[leftBottom] = -127;
}
else
{
motor[rightTop] = 0;
motor[leftTop] = 0;
motor[rightBottom] = 0;
motor[leftBottom] = 0;
}
while (true)
{
motor[rightFront] = vexRT[Ch3] - vexRT[Ch1] - vexRT[Ch4];
motor[rightBack] = vexRT[Ch3] - vexRT[Ch1] + vexRT[Ch4];
motor[leftFront] = vexRT[Ch3] + vexRT[Ch1] + vexRT[Ch4];
motor[leftBack] = vexRT[Ch3] + vexRT[Ch1] - vexRT[Ch4];
}
}