View Single Post
  #5   Spotlight this post!  
Unread 08-02-2007, 07:04
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Controlling motor speed

Here is the easiest way to do this in easyC.

Code:
      int Arm_Joystick; 
      unsigned char Arm_Output; 

      while ( 1 )
      {
            Arm_Joystick = GetOIAInput ( 2 , 2 ) ; // Analog OI Input Block
            Arm_Output = ((( Arm_Joystick - 127 ) / 4) + 127 ) ; // User Code Block
            SetPWM ( 4 , Arm_Output ) ; // PWM Control Block
      }
Here is a more advanced way to do this in easyC Pro

Code:
while (1)
  {
         SetPWM ( 5 , ((( GetOIAInput(2,2) - 127) / 4) +127 ) ) ;
  }
Oh, and when you put a smiley in your post all you have to do is click on the smile you want once and the forum software
automagicly loads the image.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 08-02-2007 at 07:08.