Загрузка страницы

Control your mouse with Arduino! Automate simple tasks!

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

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

We designed this circuit board for beginners!
Kit-On-A-Shield: https://amzn.to/3lfWClU

SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------

We use Rev Captions for our subtitles
https://bit.ly/39trLeB

Arduino UNO R3:
Amazon: https://amzn.to/37eP4ra
Newegg: https://bit.ly/3fahas8

Budget Arduino Kits:
Amazon:https://amzn.to/3C0VqsH
Newegg:https://bit.ly/3j4tISX

Multimeter Options:
Amazon: https://amzn.to/3rRo3E0
Newegg: https://bit.ly/3rJoekA

Helping Hands:
Amazon: https://amzn.to/3C8IYXZ
Newegg: https://bit.ly/3fb03X1

Soldering Stations:
Amazon: https://amzn.to/2VawmP4
Newegg: https://bit.ly/3BZ6oio

AFFILIATES & REFERRALS
---------------------------------------------------
►Audible Plus Free trial: https://amzn.to/3j5IGrV
►Get LastPass: https://lastpass.wo8g.net/b3N1vk
►Join Honey- Save Money https://bit.ly/3xmj7rH
►Download Glasswire for Free:https://bit.ly/3iv1fql

FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook: https://www.facebook.com/ProgrammingElectronicsAcademy/
Twitter: https://twitter.com/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 pre-installed 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 pre-installed 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 pre-installed on the Arduino IDE.

And these are all the functions in the Mouse library. But if we want to use these functions in our sketch, we still need to include the library. And that would look like this. This line of code right here is gonna tell the program, Hey, we're gonna be using functions from this Mouse library. If you try to run this program, but you don't include the Mouse library, it's not gonna know what any of these functions are. So that's an important step.

CONTINUED…
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.***

Видео Control your mouse with Arduino! Automate simple tasks! канала Programming Electronics Academy
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
19 ноября 2021 г. 20:33:30
00:35:15
Яндекс.Метрика