Our robot is having some problems with the wiring. We plugged a motor wire into a sort of extension piece, and plugged that into another extension that can take 2 motor wires. We basically took 2 motors and combined them into 1. When we plugged it into the cortex, only 1 side worked. Do you guys have any ideas on what we can do? We already tried a different motor and the coding is fine. Thank you.
Are you using motor controllers? If not those are needed for 2 wire motors.
Yea we are. We have 2 of those plugged into 1 cord that is black and red.
#pragma config(Motor, port1, leftmotor, tmotorVex393_HBridge, openLoop, reversed)
#pragma config(Motor, port4, motorSecondArm, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, motorArm, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, thrower, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, rightmotor, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
while(true)
{
motor[leftmotor] = vexRT[Ch2];
motor[rightmotor] = vexRT[Ch3];
motor[thrower] = vexRT[Ch5];
motor[motorArm] = vexRT[Ch6];
motor[motorSecondArm] = vexRT[Ch6];
//=======================================================thrower
if(vexRT(Btn7U) == 1)
{
motor[thrower] = 127;
}
//====
else if(vexRT(Btn7D) == 1)
{
motor[thrower] = -127;
}
//====
else
{
motor[thrower] = 0;
}
//======================================================
if(vexRT(Btn6U) == 1)
{
motor[motorArm] = 63;
}
//====
else if(vexRT(Btn6D) == 1)
{
motor[motorArm] = -63;
}
//====
else
{
motor[motorArm] = 0;
}
//=======================================================
if(vexRT(Btn6U) == 1)
{
motor[motorSecondArm] = 63;
}
//====
else if(vexRT(Btn6D) == 1)
{
motor[motorSecondArm] = -63;
}
//====
else
{
motor[motorSecondArm] = 0;
}
//=====================================================
}
}
yes we are using them.
Yea we are were using 2 of them that connect into one
try changeing the wire splitter
Are you using 2 motor controllers that go into 1 motor controller?
Send a picture of your wiring
We have and that didn’t work
One motor controller probably doesn’t work
Try running one at a time, and see if anything will run.
did you swap the two motor controllers and did the non functioning motor change or stay the same?
I swapped the motor controllers and that made it to where the functioning got worse. I then tried 1 at a time and that didn’t work either. After I did that I decided to see if we really needed the extensions and took off the extensions, and the only thing that did was make it to where our launcher acted on its own. I am seriously lost on this.
I made a reply of the code so if you think something is wrong with it, you can check.
Ok give us a little more description, when you swapped the motor controllers, please tell us what happened? did either motor run? I can’t picture ‘worse’. I was wondering if the motor that worked before the switch did not work after the switch? and if the motor that didn’t work before the switch started working? or still did not work.
When you tried one at a time how did you wire them up? still with the Y cable? can you try each motor without the Y and see if it works.
With respect to the code… is it the code posted above in the thread? Which motor are you having trouble with?
this looks not corect to me:
motor[thrower] = vexRT[Ch5];
motor[motorArm] = vexRT[Ch6];
motor[motorSecondArm] = vexRT[Ch6];
```is it the motorArm and secondArm you are having trouble with?
Ch6 I thought is just a button off/ on, and that code is probably the problem. I wouldn't know why it would ever run.
Let me know isf that is the code above, and if the three motors I pasted you are having trouble with? post the whole code if you can.
I think you want something like this:
if (vexRT[Btn6U]) {
motor[motorArm] = 120;
motor[motorSecondArm] = 120;
}
else {
motor[motorArm] = 0;
motor[motorSecondArm] = 0;
}
where 120 is an arbitrary motor value, and you would need to make it a value that works for your robot, It might even need to be negative. I do not know since I don’t know how your robot is built.
and you’d need to do a similar segment for the thrower. because ch5 is two buttons also.
Hope this helps. Let us know.