View Single Post
  #2   Spotlight this post!  
Unread 31-01-2007, 22:57
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: limiting voltage to the speed controller

you can set up a look up table.
ie: an array with 256 elements where each element has a value from 0-255

so if it were 50% push on a joy stick that would look like array[192] = 147ish

you can also run the joystick value through a math function to get your answer
left = ((left -127) /2 ) + 127

btw thats our "half the displacement" algorithm
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.