airernie Posted January 8, 2015 Report Posted January 8, 2015 I have a DTA Rotary Encoder wired with eight rotary switches; FSUIP4 finds the device and I've been able to map the switches in the "Buttons & Switches" tab and they all work fine. However, I would like to make the switches a bit courser. Right now it takes multiple clicks to change degrees on the VOR, etc., so it's not very realistic. I've not done any LUA programming, but have done programming and am willing to attempt LUA if that is the solution to my goal. Just need some advice, direction, etc. Thanks, Ernie
Pete Dowson Posted January 8, 2015 Report Posted January 8, 2015 I have a DTA Rotary Encoder wired with eight rotary switches; FSUIP4 finds the device and I've been able to map the switches in the "Buttons & Switches" tab and they all work fine. However, I would like to make the switches a bit courser. Right now it takes multiple clicks to change degrees on the VOR, etc., so it's not very realistic. How many clicks? With rotary encoders one click is either and "on" or an "off", so to get an increment or decrement on every click you need to assign the same thing to both "press" and "release" on the buttons assignments tab. This should make it twice as fast, to start with. Next, when you turn it fast the click rate may be higher than FSUIPC's default scan rate. You can change the scan rate -- see your FSUIPC4.INI file (in the Modules folder). In the [buttons] section you should finme a "PollInterval" parameter. If not add one. The default value is 25 (25 mSecs = 40 scans per second). That's fast enogh normally, but you could try lower values here. Failing this, if you really want a "fast" mode and a "slow" mode, then, yes, you could detect the button changes in a Lua plug in and if there's less than x milliseconds between each, make an increment of 10 instead of 1 and write it back directly instead of using INC/DEC operations. For this I would tend to make it read the current value (from the appropriate offset), and go up/down to the next multiple of 10, rather than just add 10, as it gives a more predictable, tidy result. Regards Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now