This was originally posted in the official questions section.
Grandpa3:
Eli
Thanks for your patience with me & your quick responses.
I’ve never used this program nor are there any remarks in it to give me a clue as to what it does. Thanks to you I did find it, did compile & download it, & ran it. Nothing happend. I only have 2 - 393 motors connected to ports 2 & 3 with motor contollers for each. I have nothing else plugged in except a charged battery & my USB-USB cable. Wasn’t sure what to expect but when nothing happend I compiled & downloaded my simple testing program
#pragma config(UART_Usage, UART2, uartNotUsed, baudRate4800, IOPins, None, None)
#pragma config(Motor, port2, test2, tmotorVex393, openLoop)
#pragma config(Motor, port3, test3, tmotorVex393, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !! //
task main()
{
while(true)
motor[test3] = 60;
motor[test2] = 60;
}
When I run this now the higher port 3 motor runs but not the one on port 2. If I remark out the line motor[test3]…, recompile, download, & run the motor on port 2 works fine. Seems like loading the default code caused the problem to be reversed. I’m trying to give you as complete & accurate information as I have but my knowledge in this situation is limited. Thanks for your continued assistance.
Grandpa3
The code you posted will not work correctly, the main task terminates with unpredictable results. Try this slightly modified version, it should run both motors.
#pragma config(UART_Usage, UART2, uartNotUsed, baudRate4800, IOPins, None, None)
#pragma config(Motor, port2, test2, tmotorVex393, openLoop)
#pragma config(Motor, port3, test3, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
motor[test3] = 60;
motor[test2] = 60;
while(1)
wait1Msec(10);
}
The while loop at the end stops the task terminating.
If you want joystick control try this.
#pragma config(UART_Usage, UART2, uartNotUsed, baudRate4800, IOPins, None, None)
#pragma config(Motor, port2, test2, tmotorVex393, openLoop)
#pragma config(Motor, port3, test3, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(1)
{
motor[test3] = vexRT Ch3 ];
motor[test2] = vexRT Ch2 ];
wait1Msec(10);
}
}
happy coding.