UI for Project users

Hi,

I am creating a gaming keypad using an arduino. Right now I edit my different key bindings directly in the arduino ide. I would like to make a GUI so my friends who aren't as tech savvy can have a simple interface to do the same. Basically I want to make a program that has an image of the keyboard where they can click a key and assign a character to it. I would do this in something like visual studio. Currently I don't know how to connect the GUI and code running on the arduino.

Would I need a seperate memory board that the computer program writes a .txt file to and the arduino reads from it? If so what is a good memory board and do you have a link to any sample code? Is there a better way to go about this and is it even possible?

Thanks in advance.

AGORSHKOV:
Currently I don't know how to connect the GUI and code running on the arduino.

I don't know exactly what you mean by that.

If you want your GUI to upload a new program to the Arduino you could do so using the Arduino command line. I use that with the Geany editor for all my normal Arduino programming

On the other hand if you just want your GUI to send some data to a running Arduino program then you need to write some code into the Arduino program so it can switch to a mode in which it accepts the data (and maybe stores it to the Arduino EEPROM). The business of receiving the data can follow the examples in Serial Input Basics

...R

Hi AGORSHKOV,

I'm currently creating similar purpose keyboard as well (will be mass produced), yet I didn't looked at this in depth, but as far as I know (and as ppl above said) you just send serial commands to Arduino and code Arduino to remap keys accordingly.
Biggest problem I found that other people face is dynamically detecting serial port, it seems it's a bit tricky – some scan all ports by sending some specific serial command and if Arduino responds they stick to that port. I'll try to find better way when I'll come to this stage of development...

Would be interesting to see your project and collaborate in the future on this issue.
Tho now it's still empty, I will start to post my progress on Twitter soon (@tweet_cgaces).

Hi Robin2,

Thanks for your reply.

Robin2:
I don't know exactly what you mean by that.

Sorry let me try to explain better. Essentially I want to have a program running on the computer that looks something like this. The user would select a key then assign a value to it. Once they are satisfied with the key bindings they would hit upload to the arduino and a version of my original sketch with the modified key bindings would be uploaded. Is this possible? It seems like the first method you listed might work if I can make my software open and run the arduino command line.

I could communicate the keybindings to the arduino through serial and have it running code that remaps keys based on the incoming data. The problem is it will forget them when the computer is powered down. I am afraid to use the EEPROM because I don't know how much memory I will need in the end and it could end up being more than what the EEPROM can store.

3Dgeo:
Hi AGORSHKOV,

I’m currently creating similar purpose keyboard as well (will be mass produced), yet I didn’t looked at this in depth, but as far as I know (and as ppl above said) you just send serial commands to Arduino and code Arduino to remap keys accordingly.
Biggest problem I found that other people face is dynamically detecting serial port, it seems it’s a bit tricky – some scan all ports by sending some specific serial command and if Arduino responds they stick to that port. I’ll try to find better way when I’ll come to this stage of development…

Would be interesting to see your project and collaborate in the future on this issue.
Tho now it’s still empty, I will start to post my progress on Twitter soon (@tweet_cgaces).

Hi 3Dgeo,

Without storing the data sent through serial on some form of non volatile memory how can the keymaps be stored on the arduino so that when it is powered down and then back up again it remembers the new key bindings?

I didnt even think about the serial ports. I guess I’ll burn that bridge when I get there.

My gaming keypad is a bit of a monstrosity but I still love her. Mine is not exactly manufacturing friendly. Here’s a video . Would love to see yours as well and I’m more than happy to collaborate.

AGORSHKOV:
they would hit upload to the arduino and a version of my original sketch with the modified key bindings would be uploaded. Is this possible? It seems like the first method you listed might work if I can make my software open and run the arduino command line.

Yes, I believe it would. I can think of two options - I would choose the second of these.

First idea would be to create a few lines of program code in a regular .ino file that holds the key data. Maybe the data would go into an array or an array of structs. What I have in mind is that there are a few lines of code that are easily identifiable. Then, prior to the compile and upload process your GUI program would replace that special chunk of code with the equivalent containing the key data that your user had selected.

The second idea is to put the key data (in pretty much the same format) into a short .h file that is #included by the ,ino file. Then your GUI program just needs to write the .h file.

This is my Python compile and upload program. It is very straightforward, just runs through once from top to bottom. You will see that it replaces some of the lines of code in the .ino file

...R

AGORSHKOV:
Hi 3Dgeo,

Without storing the data sent through serial on some form of non volatile memory how can the keymaps be stored on the Arduino so that when it is powered down and then back up again it remembers the new key bindings?

I didnt even think about the serial ports. I guess I'll burn that bridge when I get there.

My gaming keypad is a bit of a monstrosity but I still love her. Mine is not exactly manufacturing friendly. Here's a video . Would love to see yours as well and I'm more than happy to collaborate.

I've never had a need to store variables to Aduino non volatile memory, but I'm almost sure that it's possible and I will use this method, cos reuploading code every time you want to change key bindings is a bit silly in my opinion. And if saving data to Arduino itself will be too complicated (I dough it will) I'm sure there are some specialized I2C ICs that can store data from Arduino. As I said, as far as I know hardest task is to detect right serial port, but it's doable as well.

What switches are you using? Guessing blues?
I love the idea of putting buttons above fingers :slight_smile:
Funny, because I wanted (and still want) to make very similar game pad as yours (I am huge CnC Kanes Wrhath RTS fan), I even bought a lot of clay to sculpt it according to my hand, but for now I settled for simple, square one due to simpler design and it being useful not only in gaming but in design work (Photoshop, 3D ect..) plus not all people hands are the same. I will make it eventually, I hope... :slight_smile:

Sorry, I have nothing to share about my keyboard at the moment, I'm only now receiving parts and polishing schematic. I'm hoping to make prototype in a few weeks, tho I can tell it will have capasitive touch buttons for media controls, over 100 RGB LEDs and few other cool features...

BTW, what joystick you are using on thumb? I need those, link them please.

Robin2:
This is my Python compile and upload program. It is very straightforward, just runs through once from top to bottom. You will see that it replaces some of the lines of code in the .ino file

...R

Thanks so much. I will give this a shot

3Dgeo

They are gateron blues. Much cheaper than the cherries.
Thanks. I am moving away from the idea though. It adds a lot of complexity and I only really use 2 of the buttons above the fingers.

ohhh touch screen sounds fancy.

You can get the joystick here . They are a little pricey for manufacturing. I was unable to locate the OEM so I'm not sure what you can get with bulk volume discount. I believe its the PSP joystick

AGORSHKOV:
3Dgeo

They are gateron blues. Much cheaper than the cherries.
Thanks. I am moving away from the idea though. It adds a lot of complexity and I only really use 2 of the buttons above the fingers.

ohhh touch screen sounds fancy.

You can get the joystick here . They are a little pricey for manufacturing. I was unable to locate the OEM so I'm not sure what you can get with bulk volume discount. I believe its the PSP joystick

And how they feel? I found cheap blue knockoffs on Aliexpress that feels pretty good, at least for prototyping. I also tried browns, but they feel awful...

Few buttons add complexity? Try making key matrix with 36 MX switches, 8 touch sensor buttons and 2 rotary encoders whom each has button inside + LED matrix that reacts to them being pressed and animates entire matrix :smiley: I cant wait to get to programing... :slight_smile:

I assume your not using matrix with your keypad?
Thanx for linking that joystick, I found it on Ali for 1 Eur delivered .