View Single Post
  #4   Spotlight this post!  
Unread 13-11-2009, 21:10
NickE's Avatar
NickE NickE is offline
_
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2008
Rookie Year: 2008
Location: San Jose, CA
Posts: 620
NickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond reputeNickE has a reputation beyond repute
Re: [FTC]: Slow Down Max Speed!!

The code i put above would scale the input to the output. To limit it without scaling, do something like this:
Code:
if(vexRT[Ch1]>80){
   motor[port1] = 80;
}else if(vexRT[Ch1]<-80){
   motor[port1] = -80;
}else{
   motor[port1] = vexRT[Ch1];
}
Reply With Quote