15 Free YouTube subscribers for your channel
Get Free YouTube Subscribers, Views and Likes

Control your mouse with Arduino! Automate simple tasks!

Follow
Programming Electronics Academy

How much Arduino can you learn in 7 Days?
https://bit.ly/7_Day_Arduino_Challenge

Want to learn more? Check out our courses!
https://bit.ly/3CL6I3v

**Get the code, transcript, challenges, etc for this lesson on our website**
https://bit.ly/2Z50iyi'>https://bit.ly/2Z50iyi

**Get your Free Trial of Altium PCB design Software**
https://www.altium.com/yt/programming...

We designed this circuit board for beginners!
KitOnAShield: https://amzn.to/3lfWClU



FOLLOW US ELSEWHERE

Facebook:   / programmingelectronicsacademy  
Twitter:   / progelecacademy  
Website: https://www.programmingelectronics.com/

______________________________

Do you ever find yourself doing repetitive tasks on your computer and you think to yourself, I know this could be automated.

Well, what's cool is a lot of stuff can be automated using an Arduino and the USB libraries that come preinstalled in the Arduino IDE. This lesson is part two in a series doing a deep dive into those USB libraries.

In the previous lesson, we talked about controlling your keyboard with Arduino. In this lesson, you're gonna learn how to use the Arduino to emulate your mouse.

We're gonna go through every single function in the mouse USB library. You're gonna learn the ins and outs of each function, which functions don't work. You'll learn to avoid the common mistakes when you're programming with the mouse library.

Then we'll demonstrate a really simple program to move the mouse around and do some keyboard controls that I've been using when I'm writing test code for Python. Stay tuned. Subscribe to our YouTube channel to get more videos like this.

All right, let's dive right in. First off, it's important to know that the USB mouse library that comes preinstalled on the Arduino IDE doesn't work with all types of Arduino boards. It only works with a specific subset of Arduino boards.

And those are the ones that are designed with the 32u4 or the SAMD micro based boards. So that's gonna be a Leonardo, Esplora, Zero, a Due, the Micro and the MKR Family boards. So if you're trying to use this on an Arduino or a Mega, it's not gonna work.

It's these other ones that can emulate a USB. That's where these USB libraries will function. Now we're talking about these USB libraries, and if you go to the Arduino reference, which is my favorite page on the Arduino website, and you go to Libraries, down at the bottom, you can see there are two USB libraries, the Keyboard library and the Mouse library.

Now the Keyboard library we talked about in the previous video. So if you're interested in controlling the keyboard with your Arduino, definitely check out the previous video. We walked through every single one of these functions.

And just like this library, the Mouse library, which we're gonna look at today, has a very similar setup. You're gonna be able to click with the mouse. You'll be able to move your mouse around, press the mouse, release the mouse, check if the mouse is released.

Some pretty straightforward functions, but we're gonna walk through each one of them so you'll know how to use all of these. So right here, these are all of the functions inside the Mouse library. Now, like I mentioned, the Mouse and Keyboard library, these are the USB libraries, they come preinstalled on the Arduino IDE.



CONTINUED…
https://bit.ly/2Z50iyi'>https://bit.ly/2Z50iyi

**About Us:**
This Arduino lesson was created by Programming Electronics Academy. We are an online education company who seeks to help people learn about electronics and programming through the ubiquitous Arduino development board.

**We have no affiliation whatsoever with Arduino LLC, other than we think they are cool.**

posted by hegskyfk0