I am brand new to the world of RobotC and am using a vex cortex microcontroller and vexnet remote control. the video tutorials were great, and showed me how to program for the joysticks, however, I am building a vertical ascension robot and i want a simple up/down robot and would like to use the u/d buttons at the top. i need two motors to move in the opposite direction simultaneously at full power (one at 127, the other at -127) all help would be really appreciated!! thanks much!

Wed Oct 10, 2012 11:10 pm

JohnWatson

Site Admin

Joined: Thu May 24, 2012 12:15 pmPosts: 722

Re: brand new, channel 5 and 6 help?

It really does depend on what exactly you are trying to accomplish, how your robot is set up, etc, but a very basic if/else if statement should suffice;

You will need to have the code inside of a while loop so it continually checks for the Joystick button presses. If the 6 Up button is pressed, it will turn on the motors in ports 1 and 2 in one direction; if the 6 Down button is pressed it will turn them on the opposite direction; if neither is pressed the motors will be turned off.

As a side note, I suggest configuring the motors in the Motors and Sensors Setup window (reversing motors as necessary) to avoid having to use a negative sign to move a motor 'forward' or 'up'. It will make the code much simpler to implement and read, because (when configured properly) you will be able to use positive values on on the motors to move forward/up and negative values to move backwards/down without having to remember which ones are flipped.

Who is online

Users browsing this forum: No registered users and 2 guests

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