May 7, 201610 yr Hi all- Just bought FSUIPC as I'm building some small controllers. One is a rotary encoder with a pushbutton set up to turn the heading bug on my HSI. It works, but turns s l o w l y. I can set it up to turn fast, but it jumps 10 degrees or so when I do that. Is there a way I can tell FSUIPC to increase the speed based on how fast I'm turning the encoder? Alternately... is there a way I can use the pushbutton to toggle between fast/slow (fine/course) tuning? thanks! Andrew H e l p k e e p A V S I M f l y i n g
May 11, 201610 yr Here's how I do it with LINDA. Basically you set/reset a global variable on the push-switch UP and DOWN events. Then you check this in the events for rotating the knob left and right so you know whether to do a fast or slow operation. If you do this with the UP and DOWN events (rather than toggling the variable on the DOWN event) you can get fine adjustment when you just rotate the knob and coarse adjustment when you push and turn at the same time. I use this for all my rotary controls and it works great. (LINDA has its own SHIFT functions, BTW, so you could do this without the global variable, but historically this didn't work very well so I did it myself.) You can see all my code by visiting my forum and downloading the Almost Aviation library. This is Lua code, so you can use it without LINDA with a few changes. (Mainly you will need to use FSUIPC's library functions to maintain the global 'SHIFT' variable.) AAL_RotaryShiftActive = 0 -- This is public, so other modules can use the SHIFT local BUG_MULTIPLIER = 10 -- Determines how fast to do coarse rotary knob adjustments function AAL_Rotary_Shift_ON() AAL_RotaryShiftActive = 1 end function AAL_Rotary_Shift_OFF() AAL_RotaryShiftActive = 0 end function AAL_Heading_Bug_Left() local nSteps = 1 if AAL_RotaryShiftActive == 1 then nSteps = BUG_MULTIPLIER end for n = 1, nSteps do _HEADING_BUG_DEC() end end function AAL_Heading_Bug_Right() local nSteps = 1 if AAL_RotaryShiftActive == 1 then nSteps = BUG_MULTIPLIER end for n = 1, nSteps do _HEADING_BUG_INC() end end MarkH https://www.youtube.com/@AlmostAviation AMD Ryzen 7 9800X3D / 64Gb DDR5 / Zotac RTX 5070 Ti / 2560 x 1440 display
May 11, 201610 yr Author Thanks! Actually looks pretty straightforward! Have to look into LINDA.... H e l p k e e p A V S I M f l y i n g
January 24, 20197 yr Hi... I have doubts that FSUIPC's button polling rates and Lua load-compile-test rates would be adequate for a dial instead of a button being pushed by a finger. I'd recommend looking at the new HID facilities for joysticks, just released today. FSUIPC 4.704 or 3.992 feature these (and WideClient 6.88). Download (from "Download Links" subforum) the latest Lua plug-ins documents and examples and see the "HidDemo" lua plug-in. That does a lot more than you'd need. You'd only need to read certain "axes", those corresponding to your dials. The rest could be left to normal methods.
Archived
This topic is now archived and is closed to further replies.