Matrix Keyboard controlling LinuxCNC

More
3 years 1 month ago #280588 by panming
the resistors already exist, it's just that the schematic omits them


I want linuxcnc to have input and output pins corresponding to the number of buttons, so that I can control each LED and button independently. For example, when the spindle is turned on in the virtual panel or MDI or some other way, the LED under the spindle button will light up.

Heartfelt thanks.
The following user(s) said Thank You: AlexMagToast

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280617 by AlexMagToast
ah i see. The Matrix keyboard should already work.
Currently you can choose between modes for each key,
1. Input Pin in LinuxCNC
2. emulated Keypress. -> for example Numbers, Letters, Enter, Shift, delete and so on like an "normal" Keyboard"
3. typing of text. For example you can go to MDI and select the command field. Then press a button, which would enter a string, for example "M6 G43 T". You could then enter a number with number keys in mode 2. and Enter with another Key.

I started implementing another mode for multiplexed LEDs. I can't really test it. Would you be open to test it for me?

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280621 by panming
I haven't tested whether the matrix keyboard part can work, but I guess it should work normally with a high probability. Because I recommended it to several of my friends, and they all said it was very good.

I can provide everything I can. You can tell me if you need anything.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280647 by AlexMagToast
Hi,
check out this Code: github.com/AlexmagToast/LinuxCNC_Arduino...or/tree/keyboard_dev

I've added a function to drive multiplexed LEDs. I think it might work.
Around line 286 there are two settings:
const int LedVccPins[] = {0,1,2,3,4,5,6,7};
const int LedGndPins[] = {8,9,10,11,12,13,14};

The numbers correspond to the OUT pins on your drawing. please change them to how you connect the keyboard to the arduino.

I've implemented the python part also, but never tested it. Might work, but propably not :D

I guess it makes sence to test the arduino first.
To test could you please wire the arduino up with the keyboard,
connect it to ArduinoIDE and open Serial Monitor.
Send E0:0

After that by sending M0:1 the first LED should turn on.
Each LED is identified by a number, from 0- (rows*columns in your case 55).
You can adress it with the number behind M. The number behind : defines the State. So M5:1 turns on LED the 6. Led in the matrix.
M5:0 should turn it off.

If this works you can try if by chance the python part works too.

i am curious about your Results.
-Alex
The following user(s) said Thank You: besriworld

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280669 by AlexMagToast
i forgot: you have to set the Serial Monitor to 115200 Baud to connect.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280686 by panming
hello,Alex,I'm happy that I can get yor reply just after waking up.I read the code and it seems to work. Looking at your code, I realized that I had complicated things before, and it seems that your method is much easier to understand.

I will test it on the machine as soon as possible.

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum