Button array cdu

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Button array cdu

#1 Post by Shimokuta »

Hi

I am currently creating a CDU for my sim.
I mis read the limitations of creating a button array for the keypad of 8 rows/ columns.
I was thinking this was per array, and not per arduino!
8 row/column is not sufficient for my cdu.
What options do i have for creating the key pad with about 65 buttons?

Grtz

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Button array cdu

#2 Post by Sling »

Not sure it’s per Arduino. Have you tried? In any case if you only need 65 then just add an extra single button to the 64 in the array and you have what you need.

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

Re: Button array cdu

#3 Post by Ralph »

It's not per Arduino as far as I know.

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

Re: Button array cdu

#4 Post by Keith Baxter »

Hmmm...

I know the wiki says 8x8 but I did this some time ago for the Zibo as a test and it worked.

However you can have more than 1 button array per board as long as there are enough pins. I did one some time back in the beta but cannot find it. If i do find it I will post here to save you some time.

try this
test-Button Array - .siff
(7.8 KiB) Downloaded 67 times
The siff might be on the forum. I think I sent it to Gilles @SimPassion back then.

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: 7918
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Button array cdu

#5 Post by Ralph »

8x8 yes, but then just start another.

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

Re: Button array cdu

#6 Post by Keith Baxter »

Ralph wrote: Sat Feb 25, 2023 2:58 pm 8x8 yes, but then just start another.
100%

I did that already. Cannot find it. Got lost when we had the beta CTD issues.

I did a inline function version 😂

Trying to see if I can find it.

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 

SimPassion
Posts: 5338
Joined: Thu Jul 27, 2017 12:22 am

Re: Button array cdu

#7 Post by SimPassion »

Here's what I've made already in the Z_2D_XP MCDU, which can be used straight forward, for hardware only feature, with masking the bitmap on screen display (Air Manager feature on Panels)

Code: Select all

-------------------------------------

--		| Array I/O |

--	69	I/O	: PUSH BUTTONS (MCDU Keys) with direct individual input

--			or

-- from the SI WIKI : https://siminnovations.com/wiki/index.php?title=Hw_button_array_add

-- A button array is a way to connect a lot of buttons to your project with a reduces required pin count.
-- Normally, every button would need a separate pin.
-- With the button array, you can decrease the number of pins needed by arranging the buttons into a grid (see schematic below).

-- The grid has two different types of pins, rows and columns. Rows are set as an output and will be actively driven.
-- Columns are set as input and are read to see if a button changed state.

-- https://siminnovations.com/wiki/images/0/0b/Button_array_schematic.png

--	16	I/O	: for 8 x 8 Buttons Array = 64 Push Buttons Maxi
--	5	I/O	: for 2 x 3 Buttons Array = 6 Push Buttons Maxi, the last is not used in this case

--		= 21 I/O

--			or

--	37	I/O	: for 4 x 8 pins + 1 x 5 pins = (4 x (4 x 4 buttons) + 1 x (2 x 3 buttons) Buttons Array) = 70 Push Buttons Maxi

------------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

if bln_btnarray == true then
	prtdbg("BUTTON ARRAY","SELECTED "..arr_str,"dbg07",true)
	if arr_str == str_arr1 then
		hw_btn_arr1	= hw_button_array_add("MCDU Push Buttons Array#1 : 8 x rows & 8 x columns", 8, 8, pr_arr6_press, pr_arr6_release)
		hw_btn_arr2	= hw_button_array_add("MCDU Push Buttons Array#2 : 2 x rows & 3 x columns", 2, 3, pr_arr7_press, pr_arr7_release)
	elseif arr_str == str_arr2 then
		hw_btn_arr1	= hw_button_array_add("MCDU Push Buttons Array#1 : 4 x rows & 4 x columns", 4, 4, pr_arr1_press, pr_arr1_release)
		hw_btn_arr2	= hw_button_array_add("MCDU Push Buttons Array#2 : 4 x rows & 4 x columns", 4, 4, pr_arr2_press, pr_arr2_release)
		hw_btn_arr3	= hw_button_array_add("MCDU Push Buttons Array#3 : 4 x rows & 4 x columns", 4, 4, pr_arr3_press, pr_arr3_release)
		hw_btn_arr4	= hw_button_array_add("MCDU Push Buttons Array#4 : 4 x rows & 4 x columns", 4, 4, pr_arr4_press, pr_arr4_release)
		hw_btn_arr5	= hw_button_array_add("MCDU Push Buttons Array#5 : 2 x rows & 3 x columns", 2, 3, pr_arr5_press, pr_arr5_release)
	end
else

Shimokuta
Posts: 113
Joined: Wed Feb 03, 2021 12:52 pm

Re: Button array cdu

#8 Post by Shimokuta »

Thanks guys for the quick help
I did try a second button array on the same arduino; this did not work, so i was afraid there was a limit of a max per arduino.
So, i guess i made an error , in connecting or coding.

but good to hear there is no max per arduino, ok , only max is connections...

again thanks, i will go and try again from here

SimPassion
Posts: 5338
Joined: Thu Jul 27, 2017 12:22 am

Re: Button array cdu

#9 Post by SimPassion »

Shimokuta wrote: Sat Feb 25, 2023 5:55 pm Thanks guys for the quick help
I did try a second button array on the same arduino; this did not work, so i was afraid there was a limit of a max per arduino.
So, i guess i made an error , in connecting or coding.

but good to hear there is no max per arduino, ok , only max is connections...

again thanks, i will go and try again from here
Could you please, post your script and a picture of your arduino wiring with description, in order to help further ?

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

Re: Button array cdu

#10 Post by Ralph »

You can also use your own Arduino sketch.

Post Reply