HI, I was looking for a solution to have a button array and have a led with the button that is turrend on.
This would be useful for a button box that tells me what is on and what is off. just by looking at the led.
the code i have would use a 4x4 matrix but the leds would consume 16 pins on the Arduino plus the 8 for the buttons. Making it no possible on a NANO (20) or a Raspberry Pico would leave one pin left. Any ways to do this? Or is the mega the only solution. Binding the led to the switch is not possible as they are push buttons not fixed switches.
MIke
PS a Multiplexer or DM16chip would solve the issue
Led Array in combo with Button Array
-
- Posts: 79
- Joined: Tue Dec 01, 2020 8:50 am
Led Array in combo with Button Array
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)
(ex Name on Airmanager forum Polarair)
Re: Led Array in combo with Button Array
There are a few ways to do this. Using message port the options are plentiful but if you don’t want to get into message port then you can also multiplex the LED’s using the standard API digital in and out functions.
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: 79
- Joined: Tue Dec 01, 2020 8:50 am
Re: Led Array in combo with Button Array
Can you explain the multiplexing with the digital API?
I already use the digital out for one command to switch between two leds red and green and a button, so the button gets pressed, the red led goes on, if i press the button again the green turns on and red off, but i still need 3 pins to do this one for the button and each led gets one. As per the question it only needs to go on and off with ONE button so there are only two pins per button (led and button) but i need about 16 buttons with LED's if you know a way to lower the pin count that would be great.
Mike
PS buttons used are the 12x12mm simple tactile buttons.
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)
(ex Name on Airmanager forum Polarair)
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Led Array in combo with Button Array
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: Led Array in combo with Button Array
Exactly that. You will need 4 transistors to turn on the common cathodes unless you keep the led current low enough so an Arduino can drive 4 LED’s at once without risk of damage.
Some may say that the timing is important here and they would be right but in my experience for this number of LED’s it should be no issue. I managed this with raw 7 segment displays and no special driver way back using just AM and a few basic components. I was just testing the capabilities of AM but it was a useful and successful test.
Tony
Some may say that the timing is important here and they would be right but in my experience for this number of LED’s it should be no issue. I managed this with raw 7 segment displays and no special driver way back using just AM and a few basic components. I was just testing the capabilities of AM but it was a useful and successful test.
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: Led Array in combo with Button Array
Probably not what you are absolutely looking for but ---I always found this fun to play with, even though it was years ago, A forgotten art.
https://en.wikipedia.org/wiki/Charliepl ... ltiplexing.
Joe
https://en.wikipedia.org/wiki/Charliepl ... ltiplexing.
Joe
Joe. CISSP, MSc.
-
- Posts: 79
- Joined: Tue Dec 01, 2020 8:50 am
Re: Led Array in combo with Button Array
Thanks guys for all the help but ill use a Mega for this as there are too many variables. Loved the videom but that does not help much but thanks @Keith.
Is there a repository for code somewhere, like a sample code for a button array. I fail to find it. What i need is how to pull the correct value from the array.
Explain: if i have an array of say 2,2 i have 4 buttons. How i know that Air manager will tell me what button is pressed if i ask via the wiki example, but how to translate that to a specific command for a specific button is unclear to my mind.
Any help is appreciated.
Is there a repository for code somewhere, like a sample code for a button array. I fail to find it. What i need is how to pull the correct value from the array.
Explain: if i have an array of say 2,2 i have 4 buttons. How i know that Air manager will tell me what button is pressed if i ask via the wiki example, but how to translate that to a specific command for a specific button is unclear to my mind.
Any help is appreciated.
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)
(ex Name on Airmanager forum Polarair)