PDA

View Full Version : DIY ButtonBoxV2 How-To and Sketch for the Community FOR FREE



memoric77
16-12-2015, 10:15
Hi Community,

as part of the construction of my previous ButtonBox versions I've put a lot of time and work and learned quite a bit and are constantly getting new ideas through the Community. Everything has startet with a conventional keyboard that I've taken apart and starting with 0 premonition. Each of you has the fun of do-it-yourself and be happy about the result, I would recommend yourself to build a box. There are anyway copies of the functionality and design, then I can also publish background informations :). That is why I publish at this point my Arduino sketch, he's the trick to the whole magic :).

In the future I would like to read into the Arduino WiFi Shield on a UDP data and processing, but here I am asked on the knowledge of the "real Brains" in the community. As the saying goes: give and take, one hand washes the other :). So if someone intends equal and knows how to do it (so far I have not yet experimented with the Arduino WiFi shield) , please contact me :) .

Have fun and feel free to donate me :)
paypal.me/memoric77

Special function:
- screenshot
- flashing headlight
- vibration on special buttons
- lot of working LEDs ...

Works on every system which supports native USB-Keyboard (PC, PS4).


Arduino Sketch (the final one):
https://drive.google.com/open?id=0B3tO95cofeQCeDNGbHNUT2xObkk

Switching Scheme (older draft to understand how it could be!):
223922

Newer one, ButtonBoxV2:
225263

Picture of my "ButtonBoxV1":
223920

Picture of my "ButtonBoxV2":
223921

Demo of my "ButtonBoxV2":

https://www.youtube.com/watch?v=pXSniAb55oc

How-To-Video "ButtonBoxV1":

https://www.youtube.com/watch?v=WVT_yaiFq-E

New Look:
230288

iRacing-Edition:
230289

Demo:
[url]https://youtu.be/lupNXmrUchc

Feel free :)

paypal.me/memoric77

deedub777
16-12-2015, 11:14
This is cool.

I have created a similar setup using an Adafruit Trinket. Can you allow access to your sketch and i can compare with mine and maybe share good ideas.

thanks.

memoric77
16-12-2015, 11:18
This is cool.

I have created a similar setup using an Adafruit Trinket. Can you allow access to your sketch and i can compare with mine and maybe share good ideas.

thanks.

You can download the code via the link ;)

Fre.Mo
16-12-2015, 11:27
Great work, I m sure it will help many of us.

deedub777
16-12-2015, 12:00
You can Download the Code via the link ;)
I sent an access request

memoric77
16-12-2015, 12:17
I sent an access request

sorry, set it to privat access only. now it´s ready to read for everyone:)

memoric77
21-12-2015, 11:33
My new Baby ;) WIP ButtonBoxV3 with PS3 Joypad

224257

224259

224623

memoric77
29-12-2015, 00:27
Mountet ;) :

224621

DIY Tablet Holder:
224622

GForce
06-01-2016, 09:58
Hi Community,

as part of the construction of my previous ButtonBox versions I've put a lot of time and work and learned quite a bit and are constantly getting new ideas through the Community. Everything has startet with a conventional keyboard that I've taken apart and starting with 0 premonition. Each of you has the fun of do-it-yourself and be happy about the result, I would recommend yourself to build a box. There are anyway copies of the functionality and design, then I can also publish background informations :). That is why I publish at this point my Arduino sketch, he's the trick to the whole magic :).

In the future I would like to read into the Arduino WiFi Shield on a UDP data and processing, but here I am asked on the knowledge of the "real Brains" in the community. As the saying goes: give and take, one hand washes the other :). So if someone intends equal and knows how to do it (so far I have not yet experimented with the Arduino WiFi shield) , please contact me :) .

Have fun!
memoric77

Special function:
- screenshot
- flashing headlight
- vibration on special buttons
- lot of working LEDs ...

Works on every system which supports native USB-Keyboard (PC, PS4).


Arduino Sketch (the final one):
https://drive.google.com/open?id=0B3tO95cofeQCeDNGbHNUT2xObkk

Switching Scheme (older draft to understand how it could be!):
223922

Picture of my "ButtonBoxV1":
223920

Picture of my "ButtonBoxV2":
223921

Demo of my "ButtonBoxV2":

https://www.youtube.com/watch?v=pXSniAb55oc

How-To-Video "ButtonBoxV1":

https://www.youtube.com/watch?v=WVT_yaiFq-E

Very nice work and thread!
Thank you very much for this!

Cu
GForce

GForce
07-01-2016, 11:50
Mountet ;) :

224621

DIY Tablet Holder:
224622

Very nice setup and work!

I've downloaded your sketch and have to say, very good, easy to handle and almost everything included allready!
For all who want to try this, a little more detailed explanation.

On markets like aliexpress or even ebay you can find an Arduino Leonardo Board for ~5US$ including shippnig to allmost all over the world.
! make sure it's and Leonardo Version if you like to use all the options memoric77 has programmed for us!

Download Arudino IDE -> use google to find the latest version
Download the sketch from memorics link in the first post.
Install Arudino IDE on your computer
Load the sketch into Arduino IDE (make adaptions to the code if you like )
Compile and transfer it to the Board.
That's it!

If you now close the connection between for example pin 2 and pin 7 on the Board, you can see as in a MS Word session or your notepad that you generate an "1".
2 and 8 is an "2" etc. etc.

Very simple.
Thanks again to memoric77 for this nice piece of work - good job!

Cu
GForce

Fre.Mo
07-01-2016, 12:58
What are your fov settings? This looks pretty realistic.

MrF1
07-01-2016, 20:31
you selling them? :)

memoric77
08-01-2016, 07:36
What are your fov settings? This looks pretty realistic.

I think its about 85 degree. Will have a look and post it in the evenening.

memoric77
08-01-2016, 07:47
you selling them? :)

Yes, I do, but only as many as I can build next to the job and my two kids and so long it makes me fumble/tinker fun:). After much deliberation I always sell my own box and then build me a new one... again and again :). Send me a PM Iif you´re interested.

GForce
08-01-2016, 07:58
I think its about 85 degree. Will have a look and post it in the evenening.

Also very interesting to me, looks really realistic.

Cu
GForce

ApexDazza
13-01-2016, 10:52
Couple of questions, what size of resistors are you running and are the switches normal auto 12v switches and what about the rotary dials? Where can you find those sort of things?

memoric77
13-01-2016, 10:57
Just added a new wiring diagramm. It doesnt match the keypad matrix in the sketch, so you have to customize the letters and numbers. But it shows, how the wiring works. If necessary use resistors.

Good luck! ;)

225261

memoric77
13-01-2016, 11:32
Couple of questions, what size of resistors are you running and are the switches normal auto 12v switches and what about the rotary dials? Where can you find those sort of things?

You can take what you want but maybe have to modify them. Take out or swap resistors from a 12V LED switch (the switch will work, but the led won´t glow). You´ll get them from each seller for electronic accessoires! But note, with my sketch, only momentary switch/button will work.

Pimp your switch :)

225269

225270

GForce
13-01-2016, 13:59
My new Baby ;) WIP ButtonBoxV3 with PS3 Joypad

224257

224259

224623

Don't know how I could have overlooked this V3 version.
Unbelivable your development with the Joypad and all the LED! Very great work!

Only one little thing..... the Labels.
Have you ever thought about exchanging them with some self printed Icons and labels instead of "P-Touch" Labels?

Keep up the great work!!

Cu
GForce

memoric77
13-01-2016, 14:26
Thank you :)

Thought about it, but self printed icons are very small and initially I found the simple labels realistic. I believe that the labels are also more likely "heartless" glued in real race cars. The mechanic will not do with the tweezers :). Actually, they would look much better from scratched second-hand metal. They are looking too clean :). Reputation GT3 it is precisely these inscriptions which I then wanted to have. A different background color would still interesting, but by the color LEDs it would also useless. Individually punched letters I would find interesting, but I would have to let them customize. Do you have a source? :)

ApexDazza
13-01-2016, 22:57
Don't know how I could have overlooked this V3 version.
Unbelivable your development with the Joypad and all the LED! Very great work!

Only one little thing..... the Labels.
Have you ever thought about exchanging them with some self printed Icons and labels instead of "P-Touch" Labels?

Keep up the great work!!

Cu
GForce

I didn't even see the thumb stick until you said this. What is it for Memoric77? Is it providing the vibration?

memoric77
14-01-2016, 06:57
You can use the stick for the in-game menues. up, down, left, right and "enter" when you press it. Not really usefull, but it works :). You can use it for other funktions up, down für brakebias etc. . And cause its analog it works like this: vertical range <500 press key "left", range >500 press key "right", the same for horizontal. So you´re able to separate the range, 500-600 key a, 601-700 key b. 701-800 key c etc. . I only wanted it to try it out. But I sold this one, building up a new one :):

The vibration is provided by a small 3v vibration motor. Easy to wire, works like a LED. Turn it/the PIN "HIGH" will let vibrate it, use a delay(250) to let it vibrate 1/4 second and turn it out "LOW".

GForce
15-01-2016, 08:07
You can use the stick for the in-game menues. up, down, left, right and "enter" when you press it. Not really usefull, but it works :). You can use it for other funktions up, down für brakebias etc. . And cause its analog it works like this: vertical range <500 press key "left", range >500 press key "right", the same for horizontal. So you´re able to separate the range, 500-600 key a, 601-700 key b. 701-800 key c etc. . I only wanted it to try it out. But I sold this one, building up a new one :):

The vibration is provided by a small 3v vibration motor. Easy to wire, works like a LED. Turn it/the PIN "HIGH" will let vibrate it, use a delay(250) to let it vibrate 1/4 second and turn it out "LOW".

Cool, thanks for the update on this!

Cu
GForce

Ivan Dumalovski Janjusic
15-01-2016, 08:34
Brilliant work, I envy you :-).

Fight-Test
18-01-2016, 01:47
Would you mind sharing how u wired the switch that allows heights and flash lights. How many flashes does it flash when hit? Is it programable? Sorry for so many questions. Awesome work.

memoric77
18-01-2016, 08:09
Have a look at this, it´s the lower right switch:
225500

It is a DPDT switch ( “Double Pole Double Throw”) and the light flashes permanent until you switch it of.



if (key == '9') { //Headlight -> Flashlight blink (cant use toggle switch)
blink = true; // Blink the LED when pressing the key 9.
}

if (blink){ //Headlights -> Flashlight blink
Keyboard.press(0x39);
delay(100);
Keyboard.release(0x39);
delay(100);
}

if (key == 'A') { //Headlights On/Off (cant use toggle switch)
digitalWrite(ledpinA0,!digitalRead(ledpinA0));
ledpinA0_state = digitalRead(ledpinA0); // Remember LED state, lit or unlit.

Keyboard.press(0x39);
delay(50);
Keyboard.release(0x39);

if(blink = true);{
blink = false;
}
}

GForce
19-01-2016, 08:55
Have a look at this, it´s the lower right switch:
225500

It is a DPDT switch ( “Double Pole Double Throw”) and the light flashes permanent until you switch it of.



if (key == '9') { //Headlight -> Flashlight blink (cant use toggle switch)
blink = true; // Blink the LED when pressing the key 9.
}

if (blink){ //Headlights -> Flashlight blink
Keyboard.press(0x39);
delay(100);
Keyboard.release(0x39);
delay(100);
}

if (key == 'A') { //Headlights On/Off (cant use toggle switch)
digitalWrite(ledpinA0,!digitalRead(ledpinA0));
ledpinA0_state = digitalRead(ledpinA0); // Remember LED state, lit or unlit.

Keyboard.press(0x39);
delay(50);
Keyboard.release(0x39);

if(blink = true);{
blink = false;
}
}

Yeah, memorics work here is really awesome!

Cu
GForce!

memoric77
29-01-2016, 13:03
WIP :)

226247

226248

GForce
29-01-2016, 13:18
WIP :)

226247

226248

Nice and clean work as usually!
Respect!! :cool::yes:

Cu
GForce

ApexDazza
07-02-2016, 10:13
Hi Community,

as part of the construction of my previous ButtonBox versions I've put a lot of time and work and learned quite a bit and are constantly getting new ideas through the Community. Everything has startet with a conventional keyboard that I've taken apart and starting with 0 premonition. Each of you has the fun of do-it-yourself and be happy about the result, I would recommend yourself to build a box. There are anyway copies of the functionality and design, then I can also publish background informations :). That is why I publish at this point my Arduino sketch, he's the trick to the whole magic :).

In the future I would like to read into the Arduino WiFi Shield on a UDP data and processing, but here I am asked on the knowledge of the "real Brains" in the community. As the saying goes: give and take, one hand washes the other :). So if someone intends equal and knows how to do it (so far I have not yet experimented with the Arduino WiFi shield) , please contact me :) .

Have fun!
memoric77

Special function:
- screenshot
- flashing headlight
- vibration on special buttons
- lot of working LEDs ...

Works on every system which supports native USB-Keyboard (PC, PS4).


Arduino Sketch (the final one):
https://drive.google.com/open?id=0B3tO95cofeQCeDNGbHNUT2xObkk

Switching Scheme (older draft to understand how it could be!):
223922

Newer one, ButtonBoxV2:
225263

Picture of my "ButtonBoxV1":
223920

Picture of my "ButtonBoxV2":
223921

Demo of my "ButtonBoxV2":

https://www.youtube.com/watch?v=pXSniAb55oc

How-To-Video "ButtonBoxV1":

https://www.youtube.com/watch?v=WVT_yaiFq-E

i tried uploading this sketch and got an error message saying:

compilation terminated.
exit status 1
Error compiling.

would you mind passing on your current sketch and wiring diagram?

memoric77
08-02-2016, 07:20
I think, its not the complete error message.

-> 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

You have to expand the sketch and all is fine (it depends on the used arduino IDE, I dont need this ad):



...
Print Screen = 0xCE
* -------------------------------------------------------------------------
*/

#include <Keypad.h>
#include <Keyboard.h>

const byte ROWS = 5; // Five rows //25 Buttons
const byte COLS = 5; // Five columns
...

GForce
02-03-2016, 05:17
I think, its not the complete error message.

-> 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

You have to expand the sketch and all is fine (it depends on the used arduino IDE, I dont need this ad):



...
Print Screen = 0xCE
* -------------------------------------------------------------------------
*/

#include <Keypad.h>
#include <Keyboard.h>

const byte ROWS = 5; // Five rows //25 Buttons
const byte COLS = 5; // Five columns
...


I had the same issue when I used your sketch for the first time, I assume, you don't have the issue because you created the sketch and everything is included within your Arduino IDE.
I wanted to test this again, but the link to the sketch is not public anymore, I get a google message like, "you don't have permission - ask the owner".

Could you please re-publish the sketch for us?
Thanks and cu
GForce

GForce
02-03-2016, 06:23
I had the same issue when I used your sketch for the first time, I assume, you don't have the issue because you created the sketch and everything is included within your Arduino IDE.
I wanted to test this again, but the link to the sketch is not public anymore, I get a google message like, "you don't have permission - ask the owner".

Could you please re-publish the sketch for us?
Thanks and cu
GForce

One addition input on this, I realized, when you have selected the wrong Arduino Board in IDE, the error message appears also with the additional line #include <Keyboard.h>.
Only Arduino Leonardo and Micro can handle the Keyboard Library.

Cu
GForce

Ajnn
02-03-2016, 07:25
One addition input on this, I realized, when you have selected the wrong Arduino Board in IDE, the error message appears also with the additional line #include <Keyboard.h>.
Only Arduino Leonardo and Micro can handle the Keyboard Library.

Cu
GForce

Always learning. I have to install the keypad instruction in library and add instruction keybord to the code also. After that i could compile the code.

GForce
02-03-2016, 08:13
Always learning. I have to install the keypad instruction in library and add instruction keybord to the code also. After that i could compile the code.

Good to hear that it is working now! :yes:

Cu
GForce

theequalizer33
03-03-2016, 05:09
This is cool well done !! sent a request for the sketch if thats ok

Ajnn
07-03-2016, 20:46
Hi memoric, nice work and amazing layout. Your rotary switch is a rotary switch 2 pole 6 position? How did you wiring then?

memoric77
23-03-2016, 13:31
Hi memoric, nice work and amazing layout. Your rotary switch is a rotary switch 2 pole 6 position? How did you wiring then?

Hi Ajnn, no, its a 3P3T rotary switch. Have a look at Aliexpress.com :)

memoric77
23-03-2016, 13:37
iRacing Edition:
230284

New look :)
230285

Ajnn
23-03-2016, 14:05
Hi Ajnn, no, its a 3P3T rotary switch. Have a look at Aliexpress.com :)

Thank You memoric77. Well in project cars if we have the seat in the minimum back position i have to "click" 10 or 12 to times to push them to their maximum front position. I have to test with the rotary switch that i have but i think that i could push only 6 times. Thanks anyway.

Fre.Mo
23-03-2016, 14:09
iRacing Edition:
230284


good job!
I would just change the THANKS and SORRY buttons to green and red, respectively.

memoric77
23-03-2016, 14:33
Have a look at my sketch. I use the blink function to use a intervall if the button is "hold". If it is hold, every 350ms (i think) the key "x" is pressed and released, pressed and released, press... until you turn the switch back to center position. But tell me, when you and Gforce have found a solution with the rotary encoder :).

memoric77
23-03-2016, 14:35
good job!
I would just change the THANKS and SORRY buttons to green and red, respectively.

I have made the labels on behalf :).

Ajnn
23-03-2016, 15:17
Have a look at my sketch. I use the blink function to use a intervall if the button is "hold". If it is hold, every 350ms (i think) the key "x" is pressed and released, pressed and released, press... until you turn the switch back to center position. But tell me, when you and Gforce have found a solution with the rotary encoder :).

Thanks, i not using your code but i will try with it and test. I suppose it works :) and now i understand why did you use 3p3t switch. Thanks it´s a great help for me.

JoeDalton
07-04-2016, 20:57
Hello by this i want to thank Markus(memoric77) for his work and his advise, without we couldnt fix our buttonbox we really enjoy this box (the v3):) its really an extra race dimension. So thanx again Markus keep up the good work ������������

Ozith
09-05-2016, 00:25
I am also posting to say thank you for sharing your sketch, and advice. I am going to try to make a box like your v3 it looks great! Thanks again .

thurlesdrunk
26-08-2016, 10:22
A huge big thank you to Markus for this thread and all the work he has put into it, and sharing it with us. The button boxes he makes are amazing! :-) It has inspired me to have a go and try and make my own button box for PS4, similar to the version 2 box.
I have sourced and ordered almost all the parts I need, except for the 4 rotary encoders (used for seat adjustment and brake adjustment in V2 box), and also the 4 LED push buttons (used for lap info, HUD, reset, motec in V2 box).
Can anyone post up a link where I could get these parts please?! Cheers, and thanks again Markus :-)

GForce
26-08-2016, 12:53
You can find all the needed parts at aliexpress.com

Search for LED momentary push button and rotary encoder.

Cu
GForce

thurlesdrunk
29-08-2016, 08:27
You can find all the needed parts at aliexpress.com

Search for LED momentary push button and rotary encoder.

Cu
GForce

Hi GForce,

Thanks for your help. And also thanks to Markus for the links he emailed me. Yes I have found all the parts on Aliexpress, now just the long wait from China to Ireland! But good things come to those who wait!
I just hope Assetto Corsa adds support on PS4 soon! :-) Thanks again guys, I will keep you posted on my progress with the box :-)

thurlesdrunk
29-09-2016, 06:53
The slow boat from china finally arrived with some of the parts :-)

Now the fun begins!

Dnns84
12-10-2016, 22:46
Holy **** that's some cool stuff.

Trans-Girl
12-01-2017, 19:23
hi, im not very bright so go gentle with me please, i have downloaded your sketch but when i open it all i get is "error could not create the sketch" any ideas where i am going wrong?
Thanks

Marzoom
09-03-2017, 12:00
Same here will not work. Shame cause I figured I'd try an Arduino board, tried different sketches and its been nothing but a headache and a waste of time and money.

Got fed up and order a board from Derek and that works like a charm and so simple to use.

Trans-Girl
09-03-2017, 17:41
Same here will not work. Shame cause I figured I'd try an Arduino board, tried different sketches and its been nothing but a headache and a waste of time and money.

Got fed up and order a board from Derek and that works like a charm and so simple to use.
I went down the Arduino leonardo route, got it to work but couldn't use a couple of switches that i would have liked, they upset everything, switching to momentary buttons and its sorted..

Who is Derek??

button box installed on my rig...
237158

N3urON
16-03-2019, 20:46
Thank you verry much for all your time and work to explain this button box, ive sent a request to download the file, if you would let me have it please. Thanks again