Keyboard and Mouse Control Remake

by waynesmat in Circuits > Arduino

211 Views, 0 Favorites, 0 Comments

Keyboard and Mouse Control Remake

IMG_1177.PNG

This instructable was recreated from one of the Arduino Bulit-in Example called Keyboard and Mouse Control. In the original example, the cursor will move when the button is pressed or when a specific key on the keyboard is pressed. However, the original example is too simple and has several problems, which are the problems I am going to solve in the recreation.

I have changed four functions in this remake. First, I change the script so the program can work in any screen. In the original example, the script only works on the Serial Monitor page in the Arduino, which is not good since a good project should be used on any screen. Second, I change the script so it will automatically press "enter" after we press the button. In the original example, we need to press "enter" on the Serial Monitor page to let the cursor move after you press the button, which makes the project difficult to use. Third, I include a rotary potentiometer to change the sensitivity of the cursor. In the original example, the cursor is moving too fast, which is a problem because it will be hard to let the cursor stays at a point we want. Therefore, by adding the sensitivity, the user can do some minor adjustments for the cursor. Last, I put the buttons in a way that it is easier for the users to know the function of each button. In the original example, it is very hard to know which button is corresponding to moving up, clicking, etc.

The original project: Click here

Supplies

  • 1 Leonardo Arduino Board
  • 1 breadboard
  • 5 10k ohm resistor
  • 5 buttons
  • 1 Rotary Potentiometer - 10k Ohm
  • 1 LCD 16x2 screen with I2C interface
  • Wires
  • Double-sided tape

The Circuit

Screen Shot 2021-04-18 at 2.54.46 PM.png

Build the circuit like the picture above.

Note:

  • The rightmost components are the buttons.
  • The green component is the LCD Screen.
  • The wire connected to D2 can also be connected to SDA.
  • The wire connected to D3 can also be connected to SCL.
  • The 5 resistors for the buttons should be 10kΩ resistors.

Building - 1

IMG_1175.JPG

Stick the buttons, LCD screen, and the rotary potentiometer onto the cardboard according to the picture above. The top button is connected to D4. The left button is connected to D6. The middle button is connected to D8. The right button is connected to D7. The bottom button is connected to D5.

Building - 2

IMG_1176.JPG

Attached the cardboard to the top of a box. Leave a side open so it will be easier to change the component inside if there is a problem.

Programming

Screen Shot 2021-04-18 at 4.45.18 PM.png

Before you start programming, make sure you install the LCD Library here or using the direct download link.

Copy and paste the code onto Arduino and upload the code to Arduino Leonard Board.

Here is the link for the code.

And Then, Its Done!

Keyboard and Mouse Control Remake

This is the link to the video.

The video includes how to use this Instructable.