ROBOTC.net Blog  

ROBOTC News

Archive for October 20th, 2010

BEST Competition Programming Templates

without comments

Hey all BEST Teams!

We’ve made a new library and sample program to help BEST teams up and running with using ROBOTC with their Cortex systems. This new template makes it really easy to customize your program for your robot without having to worry about loops, conditionals and variables too much. Here’s an example of some of the new functions.

  • ArcadeTwoWheelDrive(vexJSLeftV, vexJSLeftH, left, right);
    • Use this function to create a “arcade” (1 joystick) drive program. Pass 4 pieces of data to have the function do all the work for driving your robot.
      • 1st: MoveChannel – The joystick channel for forward and reverse.
      • 2nd: RotateChannel – The channel on the rotate port that controls left and right rotation. This value is mixed with the move channel.
      • 3rd:  leftMotor – The motor on the left side of the robot.
      • 4th:  rightMotor – The motor on the right side of the robot.
  • TankTwoWheelDrive(vexJSLeftV, vexJSRightV, left, right);
    • Use this function to create a “tank” (2 joystick) drive program. Pass 4 pieces of data to have the function do all the work for driving your robot.
      • 1st: MoveChannel – The joystick channel for “left” motor.
      • 2nd: RotateChannel – The joystick channel for “right” motor.
      • 3rd:  leftMotor – The motor on the left side of the robot.
      • 4th:  rightMotor – The motor on the right side of the robot.
  • MotorControlViaDigitalButtons(Btn7D, Btn7U, leftArm, -127,  +127,  0);
    • Use this function to control a motor via two digital buttons – Very customizable!
      • 1st:  Btn7D – The joystick button that controls speed decrease
      • 2nd: Btn7U – The joystick button that controls speed increase
      • 3rd: leftArm – The motor that is being controlled
      • 4th: -127 – The lowest value for the motor speed
      • 5th: +127 – The highest value for the motor speed
      • 6th: 0 – How fast to adjust the speed. 0 — fastest. 50 — 1.25 seconds to cover the compete range.

Download this new library and sample program today. To help you get started, we’ve written a “getting started” PDF that will help you get started with this library.

BEST Code Library V1
BEST Code Library “Getting Started

Written by Tim Friez

October 20th, 2010 at 2:37 pm

Posted in Cortex,PIC,VEX

Tagged with , , ,