Matrix Keyboard controlling LinuxCNC
- AlexMagToast
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 67
16 Sep 2023 14:52 #280931
by AlexMagToast
Replied by AlexMagToast on topic Matrix Keyboard controlling LinuxCNC
Hi,
so i found a bug, that might have prevented it from working for you.
I also updated it to Github.
I've made it a 3x3 matrix and it works like this on my setup following the method above.
so i found a bug, that might have prevented it from working for you.
I also updated it to Github.
I've made it a 3x3 matrix and it works like this on my setup following the method above.
Please Log in or Create an account to join the conversation.
16 Sep 2023 16:47 #280933
by panming
Replied by panming on topic Matrix Keyboard controlling LinuxCNC
I was able to light up the LED as directed!!When I use a matrix key and a matrix keyboard separately, they both work fine.
But When I use my panel ,there are two problems,
1.when I open the keypad macro program, the LED blinking frequency starts to decrease.
2.Because keypad and multipleds share the rows, when I set the pins of the row to be the same, both keypad and multipleds don't seem to work properly, when I type M1:1, the whole column is lit, and when I press the key, it seems to be arranged vertically.
I noticed that both macros use the same variable name, is this caused by this. Or my wiring problem.
In any case, we are one step closer to success.
But When I use my panel ,there are two problems,
1.when I open the keypad macro program, the LED blinking frequency starts to decrease.
2.Because keypad and multipleds share the rows, when I set the pins of the row to be the same, both keypad and multipleds don't seem to work properly, when I type M1:1, the whole column is lit, and when I press the key, it seems to be arranged vertically.
I noticed that both macros use the same variable name, is this caused by this. Or my wiring problem.
In any case, we are one step closer to success.
Please Log in or Create an account to join the conversation.
- AlexMagToast
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 67
16 Sep 2023 18:44 #280941
by AlexMagToast
Replied by AlexMagToast on topic Matrix Keyboard controlling LinuxCNC
Thanks for the Feedback. I changed the Code a bit, so now the Pullup resistors from the Matrix Keyboard are disabled, while the LEDs are flashed.
I guess that could help.
I guess that could help.
Please Log in or Create an account to join the conversation.
- AlexMagToast
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 67
16 Sep 2023 19:13 #280946
by AlexMagToast
Replied by AlexMagToast on topic Matrix Keyboard controlling LinuxCNC
Btw it should also work in LinuxCNC now. which Linux is your system running on?
Please Log in or Create an account to join the conversation.
17 Sep 2023 10:32 - 17 Sep 2023 10:40 #280991
by panming
Replied by panming on topic Matrix Keyboard controlling LinuxCNC
It still looks like something is wrong, when I set LedGndPins and rowPins to be the same and send M1:1, the panel looks like this(first attachment)
The number is the name I gave them, if normal he should be numbered this way. After the number is the feedback value of the button, the green unit represents the LED flashing, and the red represents normal brightness.
when I set LedGndPins and colPins to be the same and send M1:1, the panel looks like this(second attachment )I don't know what causes it, which two arrays should I set to be the same. Or do I have a problem wiring.
The number is the name I gave them, if normal he should be numbered this way. After the number is the feedback value of the button, the green unit represents the LED flashing, and the red represents normal brightness.
when I set LedGndPins and colPins to be the same and send M1:1, the panel looks like this(second attachment )I don't know what causes it, which two arrays should I set to be the same. Or do I have a problem wiring.
Last edit: 17 Sep 2023 10:40 by panming.
Please Log in or Create an account to join the conversation.
- AlexMagToast
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 67
17 Sep 2023 11:45 #280992
by AlexMagToast
Replied by AlexMagToast on topic Matrix Keyboard controlling LinuxCNC
can you please post the settings you use in the second configuration?
The rowPins are Pullup Inputs, so they should not be used twice.
The ColPins are GND Pins for the Matrix Keyboard and the LEDs.
so set colPins und ledGndPins to be the Out0-8 Pins.
When you wire it like this and send M1:1 the all red numbers light up simultaneously?
The rowPins are Pullup Inputs, so they should not be used twice.
The ColPins are GND Pins for the Matrix Keyboard and the LEDs.
so set colPins und ledGndPins to be the Out0-8 Pins.
When you wire it like this and send M1:1 the all red numbers light up simultaneously?
Please Log in or Create an account to join the conversation.
17 Sep 2023 12:00 - 17 Sep 2023 12:02 #280993
by panming
Replied by panming on topic Matrix Keyboard controlling LinuxCNC
yes,Yes, they lit up at the same time. And, when I type M1:0, they don't turn off, but when I type M2:1, several LEDs of M1 turn off.At the same time the third column began to light up, i.e. 2, 10, 18...
Last edit: 17 Sep 2023 12:02 by panming.
Please Log in or Create an account to join the conversation.
- AlexMagToast
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 67
17 Sep 2023 12:28 #280995
by AlexMagToast
Replied by AlexMagToast on topic Matrix Keyboard controlling LinuxCNC
get the latest Code from Github.
It works in my test.
Also i think you misunderstand the use of the command.
the Number after M represents one LED. So looking at your table, each Number is one LED and can be written by one M code.
So only type M0:1 it should only turn on LED 0. (top left corner).
Also the way your keyboard is wired, i think it might be numbered differently.
ive changed the code to cycle through all the LEDs once / loop, therefore it should work better now, without the flashing.
It works in my test.
Also i think you misunderstand the use of the command.
the Number after M represents one LED. So looking at your table, each Number is one LED and can be written by one M code.
So only type M0:1 it should only turn on LED 0. (top left corner).
Also the way your keyboard is wired, i think it might be numbered differently.
ive changed the code to cycle through all the LEDs once / loop, therefore it should work better now, without the flashing.
Please Log in or Create an account to join the conversation.
- AlexMagToast
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 86
- Thank you received: 67
17 Sep 2023 12:41 #280997
by AlexMagToast
Replied by AlexMagToast on topic Matrix Keyboard controlling LinuxCNC
i think i found a mistake, i'm working on it.
The following user(s) said Thank You: panming
Please Log in or Create an account to join the conversation.
17 Sep 2023 12:52 #281001
by panming
Replied by panming on topic Matrix Keyboard controlling LinuxCNC
To prevent misunderstandings caused by translation software, I uploaded a video on YouTube.
Please Log in or Create an account to join the conversation.
Time to create page: 0.133 seconds