View Single Post
  #1   Spotlight this post!  
Unread 11-02-2006, 13:27
Unholy Unholy is offline
electrical / makeshift programmer
AKA: Daniel
FRC #1402
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2002
Location: Orlando, FL
Posts: 21
Unholy is an unknown quantity at this point
Send a message via AIM to Unholy
issues limiting a joystick input

I'm trying to limit the speed in a motor through programming in in such a way that when the joystick is fully deflected, i will only get a response of, let's say, 93 instead of 0, and 150 instead of 255. The way the joystick is set to work is that it won't be engaged unless the trigger is closed. Initially, as soon as I clicked the joystick trigger, my value would change automatically to 0 from 127 using a command looking like this:


if (p3_sw_top == 1 )
{
pwm03 = (((p3_x) *2) / 10)
}

Initially I thought I had issues with the trim, but I checked the trim using pwm03 = p3_x;, set it to neutral, went back to the line above, and as soon as I clicked again, my value was 0 again.
I'd appreciate any help I can help, and sorry for this noobish question
-Danny