View Single Post
  #7   Spotlight this post!  
Unread 06-12-2007, 17:29
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: EasyC Vex Programming help in RC Mode

That code is much easier to manage as well. The code for that would be:

Code:
#define Motor_Max (put your maximum value here)
#define Motor_Min (put your minimum value here)
#define statements go at the top of your code

Code:
if (GetRxInput(1,1) > Motor_Max)
SetMotor(1, Motor_Max); //Don't go any faster than your max

else if (GetRxInput(1,1) < Motor_Min)
SetMotor(1, Motor_Min); //Likewise, don't let the motor go slower than the min, regardless of what the joystick says.

else
SetMotor(1, GetRxInput(1,1)); //If the joystick is not above the max or below the minimum, assign it directly to the input.
Feel free to PM me as well.
__________________

Last edited by slavik262 : 06-12-2007 at 17:41.