View Single Post
  #5   Spotlight this post!  
Unread 21-03-2006, 23:25
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Programming VEX Controller

Code:
          Left Joystick:                           Right Joystick:
           [drive fwd]                               [arm up]
                ^                                       ^ 
                |                                       |
[drive left]<------->[drive right]       [claw open]<------->[claw close] 
                |                                       |
                v                                       v
           [drive rev]                              [arm down]
Using the joystick as mapped above, try using this code:
Code:
#include "Main.h"

void main ( void )
{
      unsigned char arm; // Create a unsigned char variable called arm

      while ( 1 )
      {
            // The Arcade Drive Code Block 
            // Connect The Left Drive Motor to Port 1 
            // Connect The Right Drive Motor to Port 2 
            Arcade2 ( 1 , 3 , 4 , 1 , 2 , 0 , 0 ) ;
            // The Arm Drive Code 
            // Connect the Arm Motors to Ports 3 and 4 
            arm = GetRxInput ( 1 , 2 ) ;
            SetPWM ( 3 , arm ) ;
            SetPWM ( 4 , arm ) ;
            // The Claw / Grabber Code 
            // Connect the Claw Motor to Port 5 
            MotorRcControl ( 1 , 1 , 5 , 0 ) ;
      }
}
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.