Jump to content
The simFlight Network Forums

Button PollInterval for rotary encoder


Recommended Posts

I'm trying to optimize the settings to get the fastest pulse rate that still works reliably for my rotary encoders:

The encoders send joystick button presses (one button for clock-wise, another one for counter-clock-wise). I have them assigned to "Vor1 Obi Inc/Dec" in fsuipc.

Basically, I have two parameters to tune (as far as I know):

  • Pulse width: Time the button stays pressed for each 'click' of the encoder. I can change this in the firmware.
  • The PollInterval setting in fsuipc.ini

I've tried setting pulse width to 20ms and the pollinterval to 5, but I'm losing clicks. 40ms pulses with 5ms polling works fine, but it takes ages to turn the OBI like that.

The strange thing is that, even with 10ms pulses, the FSUIPC menu still detects them reliably. The "Buttons+Switches" page reacts without fault. But when I assign them to controls, the pollinterval seems to be significantly longer.

Am I doing something wrong here?

edit: I should probably add that this is in P3D v3

 

 

Edited by scm@smurn.org
Link to comment
Share on other sites

Program both "press" and "release" for the same controls. That's the most you can do. Each click is either a press or a release. The default poll interval should be sufficient. Any other delay is down to the processing in the gauges, or whatever is processing the controls.

Pete

 

Link to comment
Share on other sites

Thanks Pete.

I'll guess I'll go with plan B then: Use a separate application to listen to the joystick buttons and then update the fsuipc offsets every 100ms or so, combining all clicks inbetween into one fsuipc write.

I've changed the firmware to toggle the buttons instead of a press & release cycle per click, as you suggest. I quick proof of concept shows that I can handle almost a 1000 clicks per second with an external application. That should be enough for even the most vigorous knob spinning :-)

Guess I have some programming to do this weekend....

Thanks for your help,

Stefan

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.