|
In regards to the flightstick... have you guys noticed your joysticks behaving backwards?
PWM1 = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000)
PWM2 = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000)
The thing is, though... that formula won't work when calculating with theoretical values... But when plugged into the program it works like a charm... We did one of these:
relay1_fwd = off
if p1_x< 200 then dumb
relay1_fwd = on
dumb:
relay1_rev = off
if p1_x> 100 then dumber
relay1_rev = on
dumber:
And sure enough, the joystick reads for values less than 100 when you push to the right and greater than 200 when you push to the left.
|