Bendix KN62A, KR 87 and KX155
Re: Bendix KN62A, KR 87 and KX155
Ok AM can do this but you will have to use the digital in and out as discrete lines. You will need to write a function that cycles through an output and checks the inputs and acts accordingly. The logic should use what output is currently active to know what switch has been rotated. You may be able to adapt the switch array function to do this or perhaps easier to use individual ins and outs. Let me know if you need a code example. I would need to know how an individual switch operates beforehand.
Tony
Tony
Last edited by Sling on Thu Feb 06, 2020 2:43 am, edited 1 time in total.
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
Thanks Tony,
I'll get back to you when I'm in front of it again.
I also came across the CD74HC4067 https://www.propwashsim.com/store/16ch- ... cd74hc4067
Is this some thing I can use to connect the 4 channels?
I already have some of these as they came with the Arduino starter kit I had.
I'll get back to you when I'm in front of it again.
I also came across the CD74HC4067 https://www.propwashsim.com/store/16ch- ... cd74hc4067
Is this some thing I can use to connect the 4 channels?
I already have some of these as they came with the Arduino starter kit I had.
Re: Bendix KN62A, KR 87 and KX155
No need really for an external multiplexer. They are good if you want to extend your number of I/O lines but Arduinos are pretty cheap and going direct keeps the code simpler.
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
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: Bendix KN62A, KR 87 and KX155
Seeing the price for such CD74HC4067 multiplexer board,
to lower the global amount, I would rather use multiple Arduino Nano boards, for let say the Z_2D_XP CDU/FMC which would requires as much as 71 inputs for all available keys plus one dial
Is what you were thinking about @Sling Tony as board reference like Arduino Nano ?
Gilles
to lower the global amount, I would rather use multiple Arduino Nano boards, for let say the Z_2D_XP CDU/FMC which would requires as much as 71 inputs for all available keys plus one dial
Is what you were thinking about @Sling Tony as board reference like Arduino Nano ?
Gilles
Re: Bendix KN62A, KR 87 and KX155
@SimPassion Yes Gilles. Rather use direct pins of an Arduino than complicate the code and wiring by using an external multiplexer. I love the Nano board. It’s so small and great for sim projects. Cheap too.
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
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: Bendix KN62A, KR 87 and KX155
Thanks Tony, I will include the Nano wiring chart in my maps
Gilles
Gilles
Re: Bendix KN62A, KR 87 and KX155
Hi @Sling
I'm just getting back to this, yes please can you provide a code starter.... (or some logic to my confusion.)
At the moment I have PULSE to A0, RIGHT A1, LEFT to A2 and the COMMON to GND.
This allows me to turn one dial and I get a result either the dial is turning down or up, this will work with the 4 dials as long as I don't connect the 4 COMMON lines to GND ie I only connect one at a time.
Is there another way to wire this up with the COMMON pins to another Arduino pin to read? (How do I set AM to read digital pins in or out?)
This is the code Chuck helped me with which check if the dials are turn one way or another.
I'm looking through your HW tutorials for any handy info.
I'm just getting back to this, yes please can you provide a code starter.... (or some logic to my confusion.)
Ok, to solve this problem first, I think I need to know how to wire the switch circuit/Arduino to be able to read the COMMON line which is the only unique wire each dial has .Ok AM can do this but you will have to use the digital in and out as discrete lines. You will need to write a function that cycles through an output and checks the inputs and acts accordingly. The logic should use what output is currently active to know what switch has been rotated. You may be able to adapt the switch array function to do this or perhaps easier to use individual ins and outs. Let me know if you need a code example. I would need to know how an individual switch operates beforehand.
Tony
At the moment I have PULSE to A0, RIGHT A1, LEFT to A2 and the COMMON to GND.
This allows me to turn one dial and I get a result either the dial is turning down or up, this will work with the 4 dials as long as I don't connect the 4 COMMON lines to GND ie I only connect one at a time.
Is there another way to wire this up with the COMMON pins to another Arduino pin to read? (How do I set AM to read digital pins in or out?)
This is the code Chuck helped me with which check if the dials are turn one way or another.
Code: Select all
function rotary_encoder(new_pos)
if new_pos == 1 and old_pos == 0 then print("DOWN = " .. tostring(new_pos) )
elseif new_pos == 1 and old_pos == 2 then print("UP = " .. tostring(new_pos) )
elseif new_pos == 2 and old_pos == 1 then print("DOWN = " .. tostring(new_pos) )
elseif new_pos == 2 and old_pos == 0 then print("UP = " .. tostring(new_pos) )
elseif new_pos == 0 and old_pos == 1 then print("UP = " .. tostring(new_pos) )
elseif new_pos == 0 and old_pos == 2 then print("DOWN = " .. tostring(new_pos) )
end
old_pos = new_pos
end
Re: Bendix KN62A, KR 87 and KX155
I need to know your hardware code for PULSE to A0, RIGHT A1, LEFT to A2. Your function name would indicate you are using hw_dial_add() for perhaps the left and right but as the hw_dial_add only needs 2 pins what are you using to read pulse.jasong wrote: ↑Mon Feb 17, 2020 4:49 am At the moment I have PULSE to A0, RIGHT A1, LEFT to A2 and the COMMON to GND.
This allows me to turn one dial and I get a result either the dial is turning down or up, this will work with the 4 dials as long as I don't connect the 4 COMMON lines to GND ie I only connect one at a time.
Is there another way to wire this up with the COMMON pins to another Arduino pin to read? (How do I set AM to read digital pins in or out?)
Its quite easy to set up some code to cycle through the common's with outputs and then read them as you are. I need to now hardware functions you are using though (see above).
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
Hi Tony
This is what I'm doing, it's a switch instead of hw_dial_add, as you said, what to do to read the pulse?
Looking at your HW tutorial on youtube, you demonstrate a switch with 3 Pin positions and a GND, I think this is the same representation of what I have. All 4 "dials" (switches) are connected to the same 3 Pins but each has a different GND or Common Line.
Thanks for your help.
This is what I'm doing, it's a switch instead of hw_dial_add, as you said, what to do to read the pulse?
Code: Select all
ROT_SWITCH_ENC = hw_switch_add("ROTENCSWITCH", 3, rotary_encoder)
local old_pos = hw_switch_get_position(ROT_SWITCH_ENC)
Thanks for your help.