DME generic selector knob control

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

DME generic selector knob control

#1 Post by ramberga » Tue Aug 03, 2021 9:36 pm

The generic DME Bendix/King instrument does not have any 'hardware' option available that can be used to externally control its on/off/nav1/nav2 options. Is there a way to create a hardware option for it, so an encoder or rotary switch can be used to control its operation via an Arduino board?

Doing a 'create/edit' gives access to the logic code for the DME instrument, but I am not sure what needs to be changed in the LUA code to allow an encoder to be used to control the selector knob. Can anyone help?

User avatar
Ralph
Posts: 5299
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#2 Post by Ralph » Wed Aug 04, 2021 4:15 am

Also got this by email, so it's a bit scattered across different channels. Are you sure that you want to use an encoder with a switch, seems a bit odd.

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#3 Post by ramberga » Wed Aug 04, 2021 1:37 pm

Ralph - I have an extra encoder laying around, but can use a rotary switch too. No problem.

I am looking at the LUA API functions currently. Is there an example I could follow to change from mouse control to a hardware switch control?

Thanks.

User avatar
Ralph
Posts: 5299
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#4 Post by Ralph » Wed Aug 04, 2021 2:20 pm

You can go with both options, but they will require different code. So it depends on what you want.

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#5 Post by ramberga » Wed Aug 04, 2021 2:27 pm

Ralph - I will communicate with you via email, so I'm not cluttering up the forum.

Pete

User avatar
Keith Baxter
Posts: 2960
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: DME generic selector knob control

#6 Post by Keith Baxter » Wed Aug 04, 2021 3:40 pm

ramberga wrote:
Wed Aug 04, 2021 2:27 pm
Ralph - I will communicate with you via email, so I'm not cluttering up the forum.

Pete
Hi Pete,

Welcome to the forum. Can I suggest not bothering Ralph with emails. He is a very busy and what you ask is quite easy to do.

Take out a few moments and brows through the tutorials Tony has done to assist new peeps to AM. You will find most answers and set you on the road to creating many amazing instruments.

https://www.forums.siminnovations.com/v ... 0fc76abfc2

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Ralph
Posts: 5299
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#7 Post by Ralph » Thu Aug 05, 2021 7:17 am

The forum is meant for cluttering, so don't worry.

User avatar
jph
Posts: 823
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: DME generic selector knob control

#8 Post by jph » Thu Aug 05, 2021 8:32 am

Ralph wrote:
Thu Aug 05, 2021 7:17 am
The forum is meant for cluttering, so don't worry.
Well said. :D - The videos by Sling are really good but please post anything you like to the forums at any time. There are always guys here to help. ;)
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#9 Post by ramberga » Thu Aug 05, 2021 2:13 pm

Ralph and Keith - watched the videos. Whew! I have an Arduino Leonardo coming tomorrow and will work on getting a rotary switch to control the generic DME this weekend.

Thank you guys!

Pete

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#10 Post by ramberga » Sat Aug 07, 2021 8:39 pm

Update: I edited the generic Bendix/King DME display to include a 3 way rotary switch. It works great (I had to do some trouble shooting with the callback, since 'switch_add' uses a second optional argument - 'direction' - and hw_switch_add' does not support more than one callback argument. I ended up just hard-coding 'direction = -1' in the callback function body).

However, as soon as I press 'stop' and exit from 'create/edit' and go back to 'home', the external rotary switch is not operating. It does not activate when out of running it in 'create/edit'.

As a side note, if I keep the instrument in the 'run' mode within 'create/edit', and go to 'home', then the rotary switch works. That is ok, but as soon as I added an encoder to the VOR1/ILS instrument, I can't 'run' both simultaneously, so I have to choose between the two instruments (to use an external hardware device) and 'run' only one of them. I can't use both simultaneously back 'home'.

Help!! Thanks. And yes, the DME and VOR1/ILS instruments are included in the panel I am using (C172 SP).

Pete

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests