For some reason the motors on our chainbar and our mobile goal intake aren’t running. We’ve checked ports and program errors, and we’ve got nothing. We’re wondering if maybe our cortex doesn’t work, because our mobile goal intake motors ran when on a different motor. We don’t have much time, so we’re wondering whether or not if it’s worth it to try a different cortex.
Please post your code so the community can better help you.
#pragma config(Sensor, in1, gyro, sensorGyro)
#pragma config(Motor, port2, goal1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, goal2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port4, lbar, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, rbar, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, righty, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, lefty, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, vl, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, vaccum, tmotorVex393_MC29, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
int vaccumtoggle=0;
task driver()
{
while(true)
{
motor[lefty]=vexRT[Ch3];
motor[righty]=vexRT[Ch2];
}
}
task goalintake()
{
while(true)
{
if(vexRT[Btn7R]==1)
{
motor[goal1]=127;
motor[goal2]=127;
wait1Msec(1000);
motor[goal1]=0;
motor[goal2]=0;
}
else if(vexRT[Btn7D]==1)
{
motor[goal1]=-127;
motor[goal2]=-127;
wait1Msec(1000);
motor[goal1]=0;
motor[goal2]=0;
}
}
}
task fourbar()
{
while(true)
{
if(vexRT[Btn5U]==1)
{
motor[lbar]=100;
motor[rbar]=100;
}
else if(vexRT[Btn5D]==1)
{
motor[lbar]=-100;
motor[rbar]=-100;
}
else
{
motor[lbar]=10;
motor[rbar]=10;
}
}
}
task vaccumlift
{
while(true)
{
if(vexRT[Btn6U]==1)
{
motor[vl]=100;
}
else if(vexRT[Btn6D]==1)
{
motor[vl]=-100;
}
else
{
motor[vl]=5;
}
}
}
task vaccumtask()
{
while(true)
{
if(vaccumtoggle==1)
{
motor[vaccum]=100;
}
else if(vaccumtoggle==-1)
{
motor[vaccum]=-100;
}
else
{
motor[vaccum]=0;
}
}
}
task main()
{
startTask(driver);
startTask(goalintake);
startTask(fourbar);
startTask(vaccumlift);
startTask(vaccumtask);
while(true)
{
if(vexRT[Ch1]>123)
{
vaccumtoggle=1;
}
else if(vexRT[Ch1]<-123)
{
vaccumtoggle=-1;
}
else if(vexRT[Ch4]<-123)
{
vaccumtoggle=0;
}
}
}
Have those motors ever worked with this code? Or did this just start happening?
I decided that the vacuum lift task must be the chain bar, is that correct? If so it looks fine to me, as does the fourbar task. The mogo task looks like it should work, but I would have put an else {motors = 0} in just to be safe.
By the way, vl represents our chainbar, which we call our vacuumlift, and vaccum is the motor for our roller intake.
Ok, so my deductions were correct then. I just re-read your first post, do you mean switching the mogo motors made it work? Or the motors work if you plug them in elsewhere?
Also, does the mogo intake/chain bar not move at all, or do they jitter? Based on the code I don’t think they would, but sometimes things get weird
The motors don’t stall, they just don’t run at all. And we tried the mg intake with a different cortex and it worked.