#flaps axis help

1 messages · Page 1 of 1 (latest)

feral mango
#

if i very carefully move my axis just a tiny bit, i can get that axis value to about 441, which sets flaps to 15..... (first pic)

balmy bane
#

the issue is simple

#

the preset is designed for an arduino connected potentiometer that has a range of 0 to 1023

#

but yours is a HID joystick axis that has a range 0 to 65535

#

so the math needs to be adjusted accordingly

#

try this right off the top of my head

@ 655.35 / near 0 max 100 min sp0
l0 10 < if{ 507101 (>K:ROTOR_BRAKE) quit } 
l0 25 < if{ 507201 (>K:ROTOR_BRAKE) quit }
l0 37 < if{ 507301 (>K:ROTOR_BRAKE) quit }
l0 50 < if{ 507401 (>K:ROTOR_BRAKE) quit }
l0 70 < if{ 507501 (>K:ROTOR_BRAKE) quit }
l0 85 < if{ 507601 (>K:ROTOR_BRAKE) quit }
507701 (>K:ROTOR_BRAKE)
feral mango
#

So what are the “lo 10”, “lo 25” etc?

balmy bane
#

l0 is the load register 0 to stack instruction. Read the RPN guide in the SDK website.

#

Each line is comparing the stored pot position already converted to a percentage to a certain value and acting accordingly.

#

Does it work or not?

feral mango
#

i'll know once i land in Heathrow. little more than an hour left

feral mango
# balmy bane Does it work or not?

works perfectly! thank you.

just would like to point out, i could read that entire SDK, and all of mobiflight documentation, and i still won't understand the math side of things. its not my strong suit at all in general.