Hi
Not sure I fully understand what it is you are trying to achieve.
1) You want to connect up 4 X dials(encoders) to the same arduino pins using the common pin as the identifier.
2)
a) You will be using a 4 position rotary switch to select which encoder is in use?
b) You will not be using a 4 position rotary switch to select which encoder is in use. You want the encoder that is turned to auto select.
Keith
Bendix KN62A, KR 87 and KX155
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Bendix KN62A, KR 87 and KX155
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
Re: Bendix KN62A, KR 87 and KX155
If you are certain that is working then. It just seems odd to be a 3 position switch. Not because of function but because of the pin names. left, right and pulse. I'll post some code on how you have it connected. It shouldn't take long.
Tony
Tony
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Bendix KN62A, KR 87 and KX155
Give this a try. You will have to select the right interval for the timer to give you the right responses. Let me know if you need any explanation.
Tony
Tony
Code: Select all
local i = 0
local old_pos = 0
function rotary_encoder(new_pos)
--common dial callback function
if (new_pos == old_pos + 1 or new_pos == old_pos - 2) then
if (i == 0) then
print("COM MHZ UP")
elseif (i == 1) then
print("COM KHZ UP")
elseif (i == 2) then
print("NAV MHZ UP")
elseif (i == 3) then
print("NAV KHZ UP")
end
elseif (new_pos == old_pos - 1 or new_pos == old_pos + 2) then
if (i == 0) then
print("COM MHZ DOWN")
elseif (i == 1) then
print("COM KHZ DOWN")
elseif (i == 2) then
print("NAV MHZ DOWN")
elseif (i == 3) then
print("NAV KHZ DOWN")
end
end
old_pos = new_pos
end
com_mhz = hw_output_add("Com Mhz", true)
com_khz = hw_output_add("Com Khz", true)
nav_mhz = hw_output_add("Nav Mhz", true)
nav_khz = hw_output_add("Nav Khz", true)
ROT_SWITCH_ENC = hw_switch_add("ROTENCSWITCH", 3, rotary_encoder)
old_pos = hw_switch_get_position(ROT_SWITCH_ENC)
--old_pos = fif(old_pos == nil, 0, old_pos)
timer_start(0, 10, function()
--reset all common lines
hw_output_set(com_mhz, true)
hw_output_set(com_khz, true)
hw_output_set(nav_mhz, true)
hw_output_set(nav_khz, true)
--cycle through common lines by grounding each one in turn
i = i + 1
if (i >= 4) then i = 0 end
if (i == 0) then hw_output_set(com_mhz, false)
elseif (i == 1) then hw_output_set(com_khz, false)
elseif (i == 2) then hw_output_set(nav_mhz, false)
elseif (i == 3) then hw_output_set(nav_khz, false)
end
end)
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Bendix KN62A, KR 87 and KX155
@jasong
You will need to use the following circuit betwwen each of the 4 Arduino output pins and switch common control lines. Resistor can be anything between 1K and 100K. Diode again can be almost anything. 1N4148 signal diode will do the job.
You will need to use the following circuit betwwen each of the 4 Arduino output pins and switch common control lines. Resistor can be anything between 1K and 100K. Diode again can be almost anything. 1N4148 signal diode will do the job.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Bendix KN62A, KR 87 and KX155
Please see post at;
https://a2asimulations.com/forum/viewto ... 07&t=69774
for full post and DME Files,
I have been attempting to make a radio stack components. So far I have a DME, almost. I have no electronics experience whatsoever. I just read a lot and used the Fritzing library resources from others to work out the MAX7219. It has an the On/Off switch, a 3 position switch for RMT FREQ & GS/T and the single encoder with pushbutton to changr Mhz/Khz.
I had no original idea at all and relied totally on the generous and amazing work of others.
References used for the PCBs
https://flyingforfun.weebly.com/cessna-172-cockpit.html
http://fritzing.org/projects/
References for the Arduino Script
https://www.mycockpit.org/forums/showthread.php?t=27048
http://thegeekforge.com/2017/11/10/ardu ... ial-001_a/
References XML Gauge for independent Frequency
https://www.fsdeveloper.com/forum/threa ... ml.427308/
https://www.robbiemcelrath.com/fs/guides/gps
regards
Re: Bendix KN62A, KR 87 and KX155
Wow! Looks very good! I was working on BK radio as a hobby project, with memory function and such, but I've never finished it, too much things going on with the baby and such. I'll see if I can find some time to finish it.
Just realized that it's the more modern version I was working on, 165? The one with the memory button.
Just realized that it's the more modern version I was working on, 165? The one with the memory button.
Re: Bendix KN62A, KR 87 and KX155
Update:
NAV1,NAV2 and DME Modules incorporated in one Arduino Mega.
Files available from:
https://a2asimulations.com/forum/viewto ... 07&t=71594
regards
NAV1,NAV2 and DME Modules incorporated in one Arduino Mega.
Files available from:
https://a2asimulations.com/forum/viewto ... 07&t=71594
regards
Re: Bendix KN62A, KR 87 and KX155
KN62A Complete,
User can set the RMT source and choose if unit is Primary or Secondary.
Just finishing off some of the hardware code.
User can set the RMT source and choose if unit is Primary or Secondary.
Just finishing off some of the hardware code.
Re: Bendix KN62A, KR 87 and KX155
Hello @jasong
Sorry if I came across this post just now. Really interesting stuff !
Can I please ask if you still have the VFD displays and mounting PCBs from your instruments ? (the original high voltage vacuum fluorescent displays)
I would be very interested in talking to you about the possibility of maybe buying or swapping something for them.
Please send me a private message.
Kind regards,
Joe
Sorry if I came across this post just now. Really interesting stuff !
Can I please ask if you still have the VFD displays and mounting PCBs from your instruments ? (the original high voltage vacuum fluorescent displays)
I would be very interested in talking to you about the possibility of maybe buying or swapping something for them.
Please send me a private message.
Kind regards,
Joe
Joe. CISSP, MSc.