Keypad Matrix macro

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Re: Keypad Matrix macro

Postby dezsoe » Tue Jan 30, 2018 6:06 pm

I made some experiences with 2x8 matrix, but I found it unuseable. Since then I had no time to play with it, but if you find the way, tell it to Dale (and also me), who wanted the 2x8 matrix. :)
Posts: 726
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Keypad Matrix macro

Postby beefy » Wed Jan 31, 2018 6:25 am


just got in from work and seen your post. Did a quick Google to get some info so the following is just off the top of my head (so I may be stuffing up here).

Anyway, based on the 3x4 matrix schematics I've viewed, you could connect the 3 lines to output pins and the 4 lines to input pins. Make sure you don't accidentally connect an O/P to an O/P pin. I'd check with Balazs if there's anything bad about doing that (output to input).

Then the macro would put each of the 3 O/P lines high in sequence. When O/P 1 is high, the 4 inputs are sequentially scanned. Then O/P 1 is put low, and O/P 2 is put high and the 4 inputs scanned again. Then O/P 2 is put low, and O/P 3 is put high, and the 4 inputs scanned, and so forth. So in one loop, you've scanned 3 sets of 4 buttons = 12 buttons.

That seems to be how it's done with a microcontroller, it's just looping through the set of switches till one is found closed.

I also read that you can only have ONE switch at a time pressed, based on the way a matrix keypad is wired. So you may need to do some pre-emptive thinking and figure out what the effects would be if someone pressed several buttons at the same time. A look at a matrix keypad schematic should quickly show what would happen.

Posts: 263
Joined: Mon Sep 05, 2016 10:34 am

Re: Keypad Matrix macro

Postby beefy » Wed Jan 31, 2018 6:50 pm

Sorry about the answer. Just trying to help.

I don't actually look at it as some "extreme" method of accomplishing what you want. Balazs could correct me but I don't see connecting an output to an input as anything dangerous or "way out there".

And like I said it's the standard way it seems to be done with microcontrollers.

So perhaps your question should have been how do you connect a 3x4 matrix to UCCNC. Then AFTER that you could focus on the macro.
Posts: 263
Joined: Mon Sep 05, 2016 10:34 am

Re: Keypad Matrix macro

Postby alex_s » Mon Mar 05, 2018 8:07 am

if it might help i added a normal usb keyboard encoder to my matrix, so i could asign all function in uccnc via keycodes, seemed easier then to hock up either Modbus or use the I/O of the controller :)
i used an arcade cabinet input board for this, has 64 distinct keys assignable by software with 2*8 direction inputs which can also be mapped to keys
Posts: 64
Joined: Tue Nov 29, 2016 11:45 am

Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest