Dear Barin,
Thanks for your reply, here are the pragma:
#pragma config(Motor, port1, left, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port5, claw, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, arm, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port10, right, tmotorVex393_HBridge, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
i mended the code as follow and the robot is partly working:
unsigned long motion8REndTime=0;
unsigned long motion7LEndTime=0;
unsigned long tmp;
tmp = nSysTime; // i have changed all nSysTime as tmp
No more warning came out and
6U and 6D are working, 8R was working, 7L failed and robot can only go forward but not backward.
The full version:
#pragma config(Motor, port1, left, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port5, claw, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, arm, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port10, right, tmotorVex393_HBridge, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
unsigned long motion8REndTime=0;
unsigned long motion7LEndTime=0;
unsigned long tmp;
tmp = nSysTime;
while(1==1)
{
motor[left]=vexRT[Ch2];
motor[right]=vexRT[Ch3];
if(vexRT[Btn6U]==1)
{
motor[port5]=63;
}
else if(vexRT[Btn6D]==1)
{
motor[port5]=-63;
}
else
{
motor[port5]=0;
}
if(vexRT[Btn8R]==1)
{
motion8REndTime=tmp+200;
}
else if(vexRT[Btn7L]==1)
{
motion7LEndTime=tmp+200;
}
if(tmp < motion8REndTime){ //last time warning here, now gone
motor[port1]=32;
motor[port10]=32;}
else if(tmp < motion7LEndTime){ //last time warning here, now gone
motor[port1]=32;
motor[port10]=32;}
else {
motor[port1]=0;
motor[port10]=0;}
}
}