Hello there! Gesture Mouse – Controlling Computer With a Glove.
This instructable is on making a gesture-controlled mouse in the form of a glove.
You are viewing: How To Make A Glove Mouse
The initial idea is to integrate this in FPS (First Person Shooter) games and computer pointer control, but it can also be used in other projects like a remote controlled car, mechanical hand, etc.
Hope you like the project. Leave your thoughts and suggestions in the comment section.
Thank you!
All of the above listed items can be bought by one’s own choice, albeit keep care on buying the glove.
Step 1: Know How the Sensors Work
Step 3: Readying the Glove
Before we do any programing, we’ll need to install Arduino IDE onto our computer along with MPU-6050 operating library.
Read more : How Should Work Gloves Fit
Download the IDE from here : Software | Arduino
And the MPU-6050.h library from here : ElectronicCats/mpu6050: MPU6050 Arduino Library (github.com)
Install the IDE and open the .ino code file in the editor. Include the .zip file from the GitHub repositery into the code.
Afterwards, now lets understand the working of vital portions of the code.
The code starts off by including the following libraries.
- Wire.h : This library allows the microcontroller to communicate with I2C devices. Here, I2c device is referred to MPU-6050 module, which communicates with the SCL and SDA pins.
- I2Cdev.h : This library is used for reading and writing I2C functions.
- MPU-6050.h : Controller library for MPU-6050 module.
- Mouse.h : HID Library for mouse functions.
The Wire.h, I2Cdev.h and Mouse.h generally come pre-installed with the IDE. If not, download and include these libraries from GitHub.
setup() initializes I2C communication, MPU-6050 module connection, HID mouse functionality and serial communication.
Read more : How To Get Glove Vectors For Words
loop() executes continuously the whole functionality.
moveMouse() gets rotational values from the gyro sensor and feeds them into the variable assigned.
Then, it converts the output values into pointer displacement values in the form of x and y displacement coordinates.
In the end, it calls the Mouse.move() function, which moves according to the displacement values calculated.
clickMouse() uses values from the flex sensors to detect change in bend and take actions defined in the clickIndex() and clickMiddle() functions. Both functions are assigned to the respective flex sensor.
clickIndex() makes sure of left mouse clicks based on state of the flex sensors. clickMiddle() also works in a similar fashion. The only difference is of mouse button.
After understanding the whole code, now just plug the arduino in, compile the code and upload it.
Open the serial monitor afterwards for viewing the sensor outputs.
Source: https://t-tees.com
Category: HOW