View unanswered posts | View active topics It is currently Thu Nov 27, 2014 7:07 pm






Reply to topic  [ 2 posts ] 
Help for a new programmer. Controller problems? 
Author Message
Rookie

Joined: Wed Sep 19, 2012 7:50 pm
Posts: 1
Post 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.


My code:

#pragma config(Motor, port2, rightMotor, tmotorNormal, openLoop, )


task main ()
{

while (1==1)



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!!!!!!


Wed Sep 19, 2012 7:57 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 610
Post Re: Help for a new programmer. Controller problems?
Mexgirlmindy,

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.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Sep 21, 2012 3:01 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.