Where do you think about if you are hearing the name gaming glove, maybe just a regular glove with some buttons, or a gauntlet with a joystick. I will tell you in this article. It turned out amazing, we were able to game with this thing, so keep on reading. Pretty cool if I say so myself.
Everybody likes it to play games and there are many ways of playing them. We all know PlayStation, Xbox, PC and Nintendo and the regular game controllers. The shape is slightly different per brand, but in general they all look the same. I think it is time to design something new!
During a project from school, I and my team had the order to find a problem for people with only one working hand. Most things are really hard for these people. Think about, tying shoelaces, opening the bicycle lock, putting on some clothes etc etc. But there is another problem, people with one working hand can’t use the regular game controller. It is made for two hands and can you imagine how awkward gaming must be with only one hand. We made a solution! The thing with the gaming glove is, ‘normal’ people can also use it. If you are gaming and want to eat for example chips, you always get greasy hands. But with the gaming glove that problem is solved, with the other hand you can eat as many snacks as you want.
Let’s introduce you to the gaming glove.
The Gaming Glove (GG) wasn’t made in just a day, in fact, it took use almost 3 months! The designing part was really hard, as well as the coding part. The proces looked like the following:
- thinking about what the problem was
- thinking about the design
- thinking about how to making it working
- making the design
- making it working
- testing and gaming
The problem is: people with only one hand can’t use the normal game controller the best way possible. The number of buttons they can press in a minute is significantly lower than people with two hands. Your game experience will deteriorate and you won’t enjoy gaming anymore.
In my explanation use the Xbox controller as the default game controller to compare it to the gaming glove.
So, we had to think about a design which was good-looking but also functional. As you might know, a game controller has 4 buttons (X, Y, A, B) and a D-pad, the cross with a button up, down, left and right, two joy-sticks and 4 buttons at the back of the controller. All these input options must also be available with the gaming glove. Next, it you put the GG on, it must have the feeling of wearing a piece of a futuristic gaming controller. This was a hard challenge, but we managed to find files a exoskelet from a hand online. We adjusted this files to our liking and with a 3D-printer, we made a cool looking exoskelet of a hand. On top of the frame we added some Arduino components. I will explain more about the Arduino part later on. We also placed 4 buttons. But how are you going to press these if they are on top of the only working hand and if you have two hands, it isn’t practical to press these buttons with the other hand. So, we made a system. A ring with a string goes around your finger. Pushing your finger down tightens the string. If you put a ring like this on all fingers except the thumb and run each string over one button, you can use the force of tightening the string to push the button. Doesn’t sound very easy, but it works very well. One of the joystick can be controlled with the thumb, the other is a sensor which can detect velocity, movement and placement. With this complex gadget, you can control the other joystick. The design part was solved. The most tricky part was yet to come.
To make it working with for example Rocket League on a computer, we had to use some technical components like Arduino. Arduino is a really nice combination between hardware and software. You get a tiny computer which can interact with sensors, buttons, leds and many more. If you connect it to your computer, with the Arduino app you will be able to write some code for you Arduino. After some research on the internet, we found the perfect site to guide us through the Arduino part.
Now, it is time to take a look at the code, first I want to tell you about the library that made all this possible. The XInput library made it possible to convert the input of the Arduino buttons to make it look like the inputs were not normal buttons, but looked like Xbox controller buttons. I will put links, more explanations and other important things at the end if you want to try it yourself.
Arduino has a standard structure in the code. First you put all the libraries, next all variables, then all the pins, the void setup and finish it with the void loop.
The explanation of the code:
Like I said, first I used the important library.
#include <XInput.h>
const uint8_t button1 = 2;
const uint8_t button2 = 3;
const uint8_t button3 = 4;
const uint8_t button4 = 5;
const uint8_t joystickx = A0;
const uint8_t joysticky = A1;
const uint8_t joystick2x = A2;
const uint8_t joystick2y = A3;
const int SW = 6;
const int SW2 = 7;
const int b = 1023;
As you can see, we have 4 buttons which are corresponding to the X, Y, B, A buttons. Under these 4 lines, we find the code to explain where the input from the joysticks can be found on the Arduino breadboard. If you don’t have much experience with Arduino or even don’t know what it is, no problem, make sure to follow me on Medium, because eventually I will explain it so everyone can understand Arduino perfectly. For now, I will continue with the Gaming Glove project. The SW and SW2 are the buttons of the joysticks. If you’re gaming you know you can press the joysticks, these buttons are linked to SW and SW2.
void setup() {
pinMode(button1, INPUT_PULLUP);
pinMode(button2, INPUT_PULLUP);
pinMode(button3, INPUT_PULLUP);
pinMode(button4, INPUT_PULLUP);
pinMode(SW, INPUT_PULLUP);
pinMode(SW2, INPUT_PULLUP);
pinMode(joystickx, INPUT_PULLUP);
pinMode(joysticky, INPUT_PULLUP);
pinMode(joystick2x, INPUT_PULLUP);
pinMode(joystick2y, INPUT_PULLUP);
XInput.setJoystickRange(0, 1023);
XInput.begin();
In the void setup, we can see some pretty interesting things. The first 10 lines with pinMode(pin, mode) aren’t that interesting. Which is exciting, is XInput.begin(), because this is a really important line, otherwise your game controller would do nothing.
void loop() {
boolean pressA = !digitalRead(button1);
boolean pressB = !digitalRead(button2);
boolean pressX = !digitalRead(button3);
boolean pressTRR = !digitalRead(button4);
boolean pressSW = !digitalRead(SW);
boolean pressSW2 = !digitalRead(SW2);
int joystickxvalue = analogRead(joystickx);
int joystickyvalue = analogRead(joysticky);
int joystick2xvalue = analogRead(joystick2x);
int joystick2yvalue = analogRead(joystick2y);
XInput.setButton(BUTTON_A, pressA);
XInput.setButton(BUTTON_X, pressX);
XInput.setButton(BUTTON_B, pressB);
XInput.setButton(TRIGGER_RIGHT, pressTRR);
XInput.setButton(BUTTON_Y, pressSW);
XInput.setButton(BUTTON_R3, pressSW2);
XInput.setJoystick(JOY_LEFT, joystickxvalue, joystickyvalue);
XInput.setJoystick(JOY_RIGHT, joystick2xvalue, joystick2yvalue);
}
Here are also a few important things I should mention. The XInput.setButton(button, boolean) is useful for setting up the buttons. To make all things a regular controller has on your own Arduino controller I will make a list of functions you probably want to use:
- XInput.setButton
- XInput.setTrigger
- XInput.setDpad
- XInput.setJoystick
These four functions are the ones you need to add to your code to make a working controller. If you want to play Rocket League with your controller, you don’t need all of these functions. This is why you won’t see all the functions in my code.
Another thing that comes with the Arduino is that only a small amount of the Arduino’s can handle the library “XInput”. A list of the ones who can:
- Arduino Leonardo
- Arduino Micro
There are a few others, but these aren’t Arduino related.
Now we have a design and the code to make it working, it’s time to game! You can play Rocket League, I did, and with some adjustments, all the other games are possible too. I hoped you like the Gaming Glove and let me know in the comments what your thoughts are about the GG. Follow me for more cool projects, explanation and many more things! Also, sharing is appreciated :)
Some photo’s of the Gaming Glove (links beneath the photo’s)
All links to the sites that helped me make this project a reality!