|Help for a new programmer. Controller problems?
|Page 1 of 1|
|Author:||Mexgirlmindy [ Wed Sep 19, 2012 7:57 pm ]|
|Post subject:||Help for a new programmer. Controller problems?|
I'm trying to get my motor to go forward and backwards using the joystick. I just can't get the joystick to start the motor.
#pragma config(Motor, port2, rightMotor, tmotorNormal, openLoop, )
task main ()
motor[rightMotor] = vexRT[Ch3];
And it doesn't work. If I can change " vexRT[Ch3]" to a number it will work.
Thank you for your help!!!!!!
|Author:||JohnWatson [ Fri Sep 21, 2012 3:01 pm ]|
|Post subject:||Re: Help for a new programmer. Controller problems?|
I just tested this code and it is working with no problem. This means there's probably something either connected incorrectly to the Cortex or a problem with the VEXNet connection. First, check to make sure that the correct motor is plugged into port 2 and that the batteries are fully charged. These are both common causes of a robot not working properly (incorrect wiring or low battery levels).
Next, please make sure you follow the steps outlined here on our wiki. I recommend trying the code with the Cortex/Joystick Controller hardwired first (with a USB-to-Serial cable running from the computer into the 'Program' port of the Joystick Controller, and a USB A-to-A running from the bottom of the Joystick Controller into the Cortex) as this will eliminate any wireless issues. Also, make sure you set the 'VEX Cortex Communication Mode' under the 'Robot' menu in ROBOTC to 'Vexnet or USB'. You must then compile and download a program to the Cortex and powercycle it (turn off Cortex and remove battery and USB, then plug them back in and turn the Cortex back on) before the settings take hold.
With the Joystick Controller hardwired into the Cortex and the Cortex turned on, you should see the 'Robot' and 'VEXnet' lights on the Joystick controller turn green (the Joystick light may be red, depending on batteries being installed/the Joystick Controller being turned on). The Cortex should also have green 'Ready' and 'VEXNet' lights. If not, you may need to turn the Cortex off and back on again.
Once you get the green lights, turn off the Joystick Controller and Cortex and replace the USB A-to-A cable with the VEXNet keys. You then have to turn on both the Joystick Controller and the Cortex on at roughly the same time in order for them to synch. When they are synched you should get the green lights on both the Cortex and Joystick Controller again. If they stay red, you will have to turn the Joystick Controller and the Cortex off and back on again to re-synch them.
Once the Cortex and Joystick Controller are paired and setup properly, you can compile and download programs to the Cortex as long as the Joystick Controller remains plugged into the computer.
If you are still unable to connect please let know so we can assist you further.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group