

So the following 2 lines of code do the same thing, except the second line is for the partner joystick: motor = vexRT // main joystick In RobotC, the format for the partner joysticks exactly the same as the main joystick, but with “Xmtr2” appended to the end of the Channel (Ch) or Button (Btn) code (“Xmtr2” = “transmitter 2”). So how do I control the robot using the partner joystick? In eas圜 in the joystick blocks, there’s just a dropdown asking you if you want it on joystick 1 (main) or joystick 2 (partner). To set a motor equal to the value of a joystick, one would type something like: motor = vexRT Partner Joystick Note that button groups 5 & 6 only have U and D.

You don’t have to comment every line of code, but you do have to comment every block of code if the following 6 lines of code together accomplish ABC, there needs to be a comment at the top of those 6 lines explaining what’s happening in the following section, and anything special or unusual about why it’s written the way it is. So then YOU’RE going to waste a lot of time trying to reconstruct your own thought process to figure out WHAT THE HECK YOU DID. Do you think you’re going to remember what that nifty, complex section of code does, exactly? Or why you had to do ABC in a sort-of convoluted way? HAH! No, you’re not. Now in January you’re getting ready for States and you see that your code needs to be modified.
#How to use robotc how to
Imagine this: you figure out how to do something really cool and complicated in your code during the summer, and your team goes along happily most of the year using that nifty code. Really, you are doing YOURSELF a huge favor by putting comments in your code.

There’s really no excuse for not putting comments in your code, whether you’re using eas圜 or RobotC, or any other language on this earth. Adding a floor/ceiling to your calculated motor power.In this post, I go through the following: In RobotC you must program these items yourself. Unlike eas圜, the standard text-based RobotC does not have joystick blocks that one can simply drag and drop and poof! you have arcade drive. This week, I learned how to program a joystick to drive a chassis. I will post things here as I learn them, that might be helpful to others who are also new to this language. This post is part of my journey from eas圜 to RobotC.
