VEX Robotics Design System - PowerPoint

					             VEX Robotics
             Design System




  EasyC
Drive Code
                 Outline

• The Programming Kit

• Understanding the Controller

• Your 1st EasyC Program

• Common Problems
             The Programming Kit

• EasyC v2
    • for VEX robots only                                  EasyC CD
    • EasyC Pro is for VEX & 2004-2009 FRC
• USB to serial port adapter
                                                                          USB
    • really SLOW!                                                    to serial
                                                                      adapter
    • use a serial cable if your computer has a
      serial port
• dongle & telephone cables
    • for connecting the robot to a computer
                                                  dongle     telephone cable
                  VEX Controller
                   (Transmitter)
• 6 channels
    1. x-axis of right joystick
       (0-255)
    2. y-axis of right joystick
       (0-255)
    3. y-axis of left joystick
       (0-255)
    4. x-axis of left joystick
       (0-255)
    5. right back button
       (0, 127, 255)
    6. left back button
       (0, 127, 255)
• multiple frequencies
  (replaceable crystals)
Sample Program in EasyC Pro
Select the VEX Controller
Select the VEX Controller
Select the VEX Controller
Start a New Project
Select the Controller Configuration
Type in descriptions of what you’re going to
           plug into each port.
Type in descriptions of what you’re going to
           plug into each port.
Expand Program Flow
Drag a WHILE loop onto the flow chart.
Drag a WHILE loop onto the flow chart.
Enter 1 (for true) to make an endless loop.
      Note:
      Arcade = 1 joystick drive
      Tank = 2 joystick drive
      The number of motors
      should match your robot.



Select an RC Control block.
Drag your RC Control block into the while (1) loop.
Select the numbered slot you plugged your left motor into.
   The labels from the Controller Configuration automatically appear.
Select the numbered slot you plugged your right motor into.
    The labels from the Controller Configuration automatically appear.
For Arcade change the Forward/Reverse Channel to 2
            (the y-axis of the right joystick)
For Arcade change the Rotate Channel to 1
       (the x-axis of the right joystick)
   Congratulations!




You are done writing your program.
Build & Download your program.
Build & Download your program.
Your program is finished downloading when
   the bar goes down (erases old code)
  and goes back again (loads new code).
Save your program even if it didn’t work.
 “My code won’t download!”
          (Is your robot on?)
                                                      The
                                                    POWER
                                                     switch
                                                   should be
                                                      ON.




The BATT POWER light should be green.
      Make sure to turn your transmitter on too.
          “My code won’t download!”
             (Did you use a fresh battery?)
                                                             charging station
robot           controller
battery         battery




                                           mounting straps




          What color is the BATT POWER light on the controller?
          • green: okay battery
          • red: dead battery
             “My code won’t download!”
         (Is the programming cord hooked up?)



                                                              USB
                                                          to serial
 telephone cable                                          adapter


                                                         computer
                       dongle


• The telephone cord should be plugged into the port labeled SERIAL
  on the robot controller.
• The other end of the telephone plug should be plugged into the
  dongle.
• The other end of the dongle should be attached to the computer
  (either by the USB to serial adapter or a serial cable).
              “My code won’t download!”
                  (Is the correct port selected?)




                                                              Step 2:
 Step 1:
                                                              • Pick a COM Port
 • Go to the Build & Download
   menu                                                       • Try to download your
                                                                code again
 • Select Loader Setup


Step 3:
• Keep trying all the available ports until you find one that allows you to download
   “My robot doesn’t drive right!”
      (How did you plug the motors up?)




Everything should be plugged in according to the
            Controller Configuration
      “My robot doesn’t drive right!”
       (Did you use servos instead of motors?)




• check the label

• motors spin continuously (360° of rotation)
• servos spin back and forth (120° of rotation)
     “My robot doesn’t drive right!”
    (Do you need to invert any of your motors?)




• Test drive your robot with all it’s wheels off the ground
• Look to see if any motors need to spin in the other direction
• Check Invert Direction to make a wheel spin in the other direction.
• Build & Download your modified code

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:9
posted:1/6/2013
language:English
pages:34