Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem with Rotary Encoders

Featured Replies

I connected two different types of encoders to an Arduino Nano Board and I'm now facing similar problems with both of them:

  • An KY40  encoder, officially supported by the AAO Arduino bridge
  • An  EC11EBB24C03 dual axis encoder, not supported by the Arduino Bridge.

I successfully specified some inputs on my Arduino Nano Board for both of them, and I'm able to assign events to them. Screenshot.

Unfortunately when I save these assignments they don't get "fired" afterwards on both of the encoders, when I turn my encoders or push the encoder button. So while the Assignment Dialogue catches the Inputs when I turn an encoder or push the encoder button (at least on the EC11EBB24C03), after saving the assignment the green light in the assigned buttons dialogue doesn't flash when I push a button or turn the Encoder. 

The push buttons on the encoders make a difference: While I at least can assign events to the push button on the dual axis encoder, the push button on the KY40 doesn't get recognized at all. I've tried both PIN types and reverse modes on both encoders and of course I've double ckecked the wiring.

Any Ideas why the encoder events get catched by the assignemnt dialogue, but do nothing after I've saved the assignments?

P.S: The dual axis encoders does'nt have DT and CLK connectors, but only GND, A, B, BTN connections. So the Button may work a little bit different then on the KY40s

Edited by theflyguy

  • Commercial Member

Sounds odd, that should work. The green light doesn't have to flash, that may just be too short to see. What about the control in the sim? Personally, when testing I would use events that I know that are actually working for the current aircraft (like heading bug change or something). TMBK none of the GPS events does anything in MSFS. They are there in the SDK, but none of the GPS instruments is using them.

Are you using the Bridge in stand alone or in Plugin mode? Does it even work with normal input events from the Arduino, like a simple momentary button push? 

 

Edited by Lorby_SI

LORBY-SI

  • Author
12 minutes ago, Lorby_SI said:

Sounds odd, that should work. The green light doesn't have to flash, that may just be too short to see. What about the control in the sim?

Are you using the Bridge in stand alone or in Plugin mode? Does it even work with normal input events from the Arduino, like a simple momentary button push? 

 

Sorry, I had to rewrite my initial question after I did some more testing. I'm using the bridge in Plugin mode. Yes, normal push buttons work.

Edited by theflyguy

  • Commercial Member

Not sure, I suppose that maybe that encoder works differently or requires a differnt Arduino library. IIRC, they are supposed to send "keydown-keyup-keydown-keyup" when being turned. Maybe it just sending the one, so you would get one single press and then it is stuck. 

Make sure to do some tests with ordinary events that you know to be working for the aircraft. Just to rule out that you are testing things that cannot work in the first place (like the  default GPS events...)

... and the standard rotary encoder does work??

Edited by Lorby_SI

LORBY-SI

  • Author

I'm using another home built device, to check if the assigned simulator events are working generally in the loaded Aircraft. It's built with an Arduino Pro Micro (Leonardo) with self written Firmware and acts as a HID Device. This device is also using KY40s and Buttons and I'm assigning the same simulator events to it via AAO as with the encoders connected via the arduino nano and the AAO Arduino bridge. So I'm sure to assign the correct simulator events to my encoders. 

 

No, also the Standard Encoders (KY40) show the same behaviour: I can assign Events in AAO, but they get never fired after the assignent was saved. 

 

Comparison

  • Commercial Member
4 minutes ago, theflyguy said:

No, also the Standard Encoders (KY40) show the same behaviour: I can assign Events in AAO, but they get never fired after the assignent was saved. 

Weird. I will look into that.

LORBY-SI

  • Author

OK, Problem likely solved. My fault. I've only watched the assigned function when I compared my other hardware with the encoders that are connected to the arduino bridge, but forgot to check the values for these funktions too. I just called the function with the wrong parameters. 

 

 

 

Edited by theflyguy

  • Author

I was just about to send you this graphical explanation of the problem, when I noticed the different parameters set by my HID Device vs. the encoders attached to the Arduino Nano. The Effect in the third Image may be caused by an buffer overflow, as this function generally expects a zero as parameter. 

Ah, one more thing:  I noticed, that when I change the settings for push-buttons in the Arduino Bridge plugin (and wait untli the new firmware has been loaded), there is no change to the button behaviour while assigning these buttons. I need to restart AAO to see the change getting applied to the button.

I still struggle with some of the functions I want to map to my hardware (it's the TDS GTNXi) because some of them work in a magical way. I.e. the Cursor Button does different things when pressed shortly or long, but I never used the "Long click" option in AAO. When I copy and paste the (working) assignment in AAO and just assign another button to the copied assignment it won't do the short-/long press magic, were the original assignment does. 

 

 

 

 

  • Commercial Member
1 hour ago, theflyguy said:

The Effect in the third Image may be caused by an buffer overflow, as this function generally expects a zero as parameter. 

You have "Ingore Spam" checked on, so the event will be removed when more than 20? oder 40? of it have been received.

What you are seeing here is what is coming back from the sim, not what is being sent!

1 hour ago, theflyguy said:

TDS GTNXi

Sorry, I'm not familiar with that. 

Just make sure that what you are using as events is actually working. For example, for the MSFS/WT G1000 none of the K: events is supposed to work. That device is controlled by HTML Variables (>H: and ultimately InputEvents (>IE: Those may have additional capabilities that cover the "magic" part. In any case, a long or short click on the output side must be simulated with appropriate key down + key up settings. The "Long click" feature of the AAO buttons IMHO doesn't factor into this, that is about processing the input in a certain way.

Edited by Lorby_SI

LORBY-SI

  • Author
1 hour ago, Lorby_SI said:

You have "Ingore Spam" checked on, so the event will be removed when more than 20? oder 40? of it have been received.

 

I don't think that's the reason, because the event is immediately shown again when I use the encoder on my HID-Device. This should also be seen as spam, once the event has been ignored because of "spamming" , right? Also it never took 20 or more encoder "clicks" on the encoders attached to the Nano until the event disappeared from the list. 

1 hour ago, Lorby_SI said:

What you are seeing here is what is coming back from the sim, not what is being sent!

Wow, never knew that. I mean, as far as I know ">" operators in RPN means assigning parameters to functions. So I thought - in this case - this would be the input command. Thanks for the hint.

OK, the wiring and "programming" of my hardware is finished and everything works as intended. Next Stop: Design and 3D printing of the bezel.

Your support is absolutely stunning!! Thank you very much!

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.