View Single Post
  #1   Spotlight this post!  
Unread 17-10-2012, 10:45
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: Fisher Price Motor Variable Speed Moderation

Quote:
Originally Posted by Anorak View Post
No, we have a cRIO to control it, and are programming it in C++
Are you using the correct variable types in your code? It sounds like you are using an int or char, which would only allow you to use three speeds.

You should be using a float, which can contain nearly any* decimal value. The speed controller classes, such as Victor, require a value between -1.0 and 1.0. To run at any speed other than full, simply send values like -0.62 or 0.48 or 0.11 or -0.88.


* Within a reasonable magnitude. See this for more info: http://en.wikipedia.org/wiki/Floating_point
__________________
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

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