Fmc button matrix

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

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

Re: Fmc button matrix

#11 Post by jph »

SimPassion wrote: Sun Sep 04, 2022 10:11 am
jph wrote: Sun Sep 04, 2022 9:40 am Very nice Gilles.
Can I please ask how you are enumerating the button value to the function list ?
thanks
Joe
just missed to add this part Joe, thanks for the head up :oops:

I will correct in the original post

Gilles
Thank you Gilles,
Really nice code.
Appreciated.
Joe
Joe. CISSP, MSc.

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

Re: Fmc button matrix

#12 Post by SimPassion »

Thanks Joe, hope it'll be useful in other situation. It's more me who is learning on day to day reading the forums, thanks to all simmers

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

Re: Fmc button matrix

#13 Post by jph »

No problem Gilles. I like reading your code, you have such a logical and thoughtful way of presenting it. Really easy to follow and often extremely well documented.
I learn something every time I study your code.
Some people write in a logical way to another person - that's how your code is for me, it is like reading a nicely written book.
Code is like accents, two people can say the same thing and one I can understand perfectly and the next I think "what did they just say" ? :D
Joe
Joe. CISSP, MSc.

bebe100
Posts: 59
Joined: Sat Sep 19, 2020 3:22 pm

Re: Fmc button matrix

#14 Post by bebe100 »

Thx to everyone I shall use this code

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

Re: Fmc button matrix

#15 Post by SimPassion »

While working on the mock-up, I see I've made wrong accounting on required pins number and will update here soon

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

Re: Fmc button matrix

#16 Post by SimPassion »

So here's the correct definition :

I've wrongly tried to achieve with 8 x 8 way previously, using only my 4 x 4 matrix modules, which is indeed improper and could bring some unexpected behavior. So the numbering was obviously outside the scope.

image.png

Next I eventually used 5 x (4 x 4) modules

image.png

Also, please notice internal AM output and input concern, when it come to array usage, accordingly to Sim Innovations WIKI

Now clarifying this way :

Code: Select all

--	Hardware Ready using Arduino board for Cockpit builders
-- The ZiboMod MCDU brings :
-- 69 inputs for individual Push Buttons
-- 1 input Dial for brightness handling
-- 5 outputs for individual status leds

-- so an overall of 75 single data binding and I/O
-- could be as of the following :

------------------------------------------------------------------------------------------------------------------------------------------
--			75 I/O ( 69 + 6 ) or 27 I/O ( 21 + 6 ) or 46 I/O ( 37 + 6 ), with related PINS for I/O
------------------------------------------------------------------------------------------------------------------------------------------

--		| INPUTS |

--	1	INPUT	: BRIGHT DIAL
--			or
--	1	INPUT	: BRIGHT ADC DIAL
-------------------------------------

--		| OUTPUTS |

--	5	OUTPUTS	: LEDs STATUS
-------------------------------------

--		| 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

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

-- IN ANY CASE : With any array, keys are assigned in the following order

-- ON PRESS :

	 -- [1] = press_LSK1L
	 -- [2] = press_LSK2L
	 -- [3] = press_LSK3L
	 -- [4] = press_LSK4L
	 -- [5] = press_LSK5L
	 -- [6] = press_LSK6L
	 -- [7] = press_LSK1R
	 -- [8] = press_LSK2R
	 -- [9] = press_LSK3R
	-- [10] = press_LSK4R
	-- [11] = press_LSK5R
	-- [12] = press_LSK6R
	-- [13] = press_CRZ
	-- [14] = press_DES
	-- [15] = press_HOLD
	-- [16] = press_PROG
	-- [17] = press_EXEC
	-- [18] = press_INIT
	-- [19] = press_RTE
	-- [20] = press_CLB
	-- [21] = press_MENU
	-- [22] = press_LEGS
	-- [23] = press_DEPARR
	-- [24] = press_N1
	-- [25] = press_FIX
	-- [26] = press_PREV
	-- [27] = press_NEXT
	-- [28] = press_ONE
	-- [29] = press_TWO
	-- [30] = press_THREE
	-- [31] = press_FOUR
	-- [32] = press_FIVE
	-- [33] = press_SIX
	-- [34] = press_SEVEN
	-- [35] = press_EIGHT
	-- [36] = press_NINE
	-- [37] = press_PERIOD
	-- [38] = press_ZERO
	-- [39] = press_MINUS
	-- [40] = press_A
	-- [41] = press_B
	-- [42] = press_C
	-- [43] = press_D
	-- [44] = press_E
	-- [45] = press_F
	-- [46] = press_G
	-- [47] = press_H
	-- [48] = press_I
	-- [49] = press_J
	-- [50] = press_K
	-- [51] = press_L
	-- [52] = press_M
	-- [53] = press_N
	-- [54] = press_O
	-- [55] = press_P
	-- [56] = press_Q
	-- [57] = press_R
	-- [58] = press_S
	-- [59] = press_T
	-- [60] = press_U
	-- [61] = press_V
	-- [62] = press_W
	-- [63] = press_X
	-- [64] = press_Y
	-- [65] = press_Z
	-- [66] = press_SPACE
	-- [67] = press_DEL
	-- [68] = press_SLASH
	-- [69] = press_CLR
	-- [70] =

-- ON RELEASE :

	 -- [1] =
	 -- [2] =
	 -- [3] =
	 -- [4] =
	 -- [5] =
	 -- [6] =
	 -- [7] =
	 -- [8] =
	 -- [9] =
	-- [10] =
	-- [11] =
	-- [12] =
	-- [13] =
	-- [14] =
	-- [15] =
	-- [16] =
	-- [17] =
	-- [18] = release_INIT
	-- [19] =
	-- [20] =
	-- [21] = release_MENU
	-- [22] =
	-- [23] =
	-- [24] =
	-- [25] =
	-- [26] =
	-- [27] =
	-- [28] =
	-- [29] =
	-- [30] =
	-- [31] =
	-- [32] =
	-- [33] =
	-- [34] =
	-- [35] =
	-- [36] =
	-- [37] =
	-- [38] =
	-- [39] =
	-- [40] =
	-- [41] =
	-- [42] =
	-- [43] =
	-- [44] =
	-- [45] =
	-- [46] =
	-- [47] =
	-- [48] =
	-- [49] =
	-- [50] =
	-- [51] =
	-- [52] =
	-- [53] =
	-- [54] =
	-- [55] =
	-- [56] =
	-- [57] =
	-- [58] =
	-- [59] =
	-- [60] =
	-- [61] =
	-- [62] =
	-- [63] =
	-- [64] =
	-- [65] =
	-- [66] =
	-- [67] =
	-- [68] =
	-- [69] = release_CLR
	-- [70] =

Post Reply