How To Turn An Arduino Into A USB Keyboard Or Mouse! | ATMega32U4

  Рет қаралды 121,682

Simple Electronics

Simple Electronics

Күн бұрын

Пікірлер
@Newton_beats9040
@Newton_beats9040 16 күн бұрын
If you are beginner, this is the best video to watch first. The code is simple to understad and the explanations are so precise. thanks!
@SimpleElectronics
@SimpleElectronics 12 күн бұрын
I appreciate the kind words!
@leonclose7823
@leonclose7823 2 жыл бұрын
So simple! This looks like the start of a project for my Year 9 class. A handful of mechanical keyboard switches and some 3D printing could make a cool little macro pad. Thanks for the video.
@Dilshad-gu7je
@Dilshad-gu7je 2 жыл бұрын
These projects where they help us with our daily stuff are really powerful.
@kjur18
@kjur18 2 жыл бұрын
I had one of these for some time, with 12 button keyboard that uses only one analog pin, worked great, but those buttons were a bit noisy (12mm tact switches) and a bit bulky. So my next step was to make this thinner and silent. So I used one of these MPR121 12 touch pad boards, works like a charm, and it's really thin compared to my previous one
@chriss3154
@chriss3154 Жыл бұрын
Made my foot pedal project a breeze! Quick and simple! Great thanks!👍🤘
@SimpleElectronics
@SimpleElectronics Жыл бұрын
Awesome!
@Mulakulu
@Mulakulu 10 ай бұрын
This is awesome. Gonna use some parallel in to serial out chips to get many many inputs and make a number pad. I do not like the decision of adding the 500ms delay there though, due to not being able to press any buttons for 500ms. I think I'll just not have a hold function, and rather only send inputs when they are pulled high, and ignore that button until it's pulled low again
@Mulakulu
@Mulakulu 10 ай бұрын
or I'll just do Keyboard.press and Keyboard.release. That seems better maybe
@hassanbo8200
@hassanbo8200 Жыл бұрын
does it have to strictly be the MEGA32U4 or is there any other chip that can be used like this? if there is, plz list the modules that can replace this
@TheJcrist
@TheJcrist Жыл бұрын
This is not only a keyboard but also any imaginable HID device, including UPS and 3D joystick.
@dsdailylife1126
@dsdailylife1126 6 ай бұрын
Can i copy the existing program already in it i have bought something like this that already have a program but i want to copy what's in it
@xskodemedia746
@xskodemedia746 11 ай бұрын
yo somebody with great Arduino tuts. are you still making videos about such or do you have a series of tutorials!!? I just came by your channel now and i am subscribing!
@Golem_design
@Golem_design Ай бұрын
how many independent keys can you press at the same time with your setup? thanks in advance.
@TBL_stevennelson
@TBL_stevennelson 2 жыл бұрын
Yes I do want you to build a project and maybe try one without the delay. Thanks
@rudy5360
@rudy5360 2 жыл бұрын
Could you turn it into a USB gamepad? A driving simulator controller would be a good project. Or RC model controller, reading servo PWM from an rc receiver, and sending this as a gamepad to a pc
@simonemartin-pn9zi
@simonemartin-pn9zi 21 күн бұрын
can you press and relese a key on the keyboard, like holding ctrl?
@SimpleElectronics
@SimpleElectronics 12 күн бұрын
Yup!
@h5x0r
@h5x0r 12 күн бұрын
Can one do this with an Adafruit Feather using the same libraries? Cannot seem to get it to work...
@SimpleElectronics
@SimpleElectronics 12 күн бұрын
so the best way to check if it is possible at all is to search to see if your board can do "HID" if so, you'll just have to search for a compatible library. I specifically picked the ATMega32u4 because it can do HID
@h5x0r
@h5x0r 12 күн бұрын
@@SimpleElectronics my board is advertised as HID-capable and there are libraries...what irritates me however is the fact that I do not see any additional HIDs in Windows when I connect the board. Will get an Arduino Pro Micro just to check that out. Thanks!
@h5x0r
@h5x0r 6 күн бұрын
@@SimpleElectronics Just got an Arduino Leonardo compatible board and now it works! Thanks mate! Where do I find the documentation for the keyboard.h library? I am looking for a way to send macros instead of single keystrokes
@Chaga1314
@Chaga1314 Жыл бұрын
pretty neat tutorial man. Cheers
@kyleallred984
@kyleallred984 2 жыл бұрын
I'm sure a fellow streamer could use a macropad for scene translation and other effects?
@ajinkya3.14
@ajinkya3.14 4 ай бұрын
Can it replace a keyboard for all the keys? I'm thinking of making one with push buttons.
@objection_your_honor
@objection_your_honor Жыл бұрын
I'm new to your channel and was wondering how I would be able to send a string of characters like "Left Shift + Right Ctrl + Pause" keys in one key press? Would Keyboard.print.(string), where string is an array of characters work?
@chinshanyu7394
@chinshanyu7394 3 ай бұрын
Hi, can I get some help. I have uploaded a code that let my Arduino pro micro keep typing 'testing' .and now if I plug my Arduino to my computer I can't even go into the bootloader mode. I already try to reset it by using a jumper wire to connect the reset and gnd but It still didn't works.
@hans-dieterjung4026
@hans-dieterjung4026 8 ай бұрын
Thank for your work and nice explanation. my question: if i want to used an Uno 4, what type of Hardware i need to communicat like an HID ?
@Technodude255
@Technodude255 2 ай бұрын
Perfect for my project! Thankyou!
@3xAudio
@3xAudio 7 ай бұрын
Is it straight forward to use one keyboard button to control 2 Arduinos simultaneously?
@saileshagarwal
@saileshagarwal 8 ай бұрын
Hey, Do you think we can use place keyboard module inside a smart digital tape measure, which copies the measurement from the tape directly to the excel sheet via bluetooth? Thanks!
@BrightBlueJim
@BrightBlueJim 10 ай бұрын
I was looking for how to create a combined USB mouse and keyboard using an ATmega32U4 (Arduino Micro), but had read things implying that in order to combine two devices in one micrcontroller, you had to also implement a USB Composite device. And of course, most example programs only do mouse or keyboard, but not both. However, clearly this is not the case, since your example does exactly this! Maybe it's because they're both HID class devices? Whatever, now I know how to do what I need to do. Thanks!
@duppressor8164
@duppressor8164 Жыл бұрын
Can you use this code for a RP2040? 1:34 - 5:31
@electroniquepassion
@electroniquepassion 2 жыл бұрын
Merci pour l’info 👋👋
@shawnmichaelis1609
@shawnmichaelis1609 Жыл бұрын
how to i decrease the delay speed in-between button presses? i want to be able to press as fast as possible like a normal keyboard
@lordfly88
@lordfly88 2 жыл бұрын
Exactly what I was looking for, thanks!
@xsm5525
@xsm5525 Жыл бұрын
I have two questions, (the 2nd one maybe being a bit weird) 1, is it possible to send things like the Function keys (F1-F12 etc) and the left up down right arrow keys? 2. is it possible to have 2 x arduino 32u4's on one board, and have all 5 microswitches (like your own setup here) Y-lead off to both arduino 32u4's? I want to control 2 PC's at the exact same time (don't ask!)
@romeolz
@romeolz Жыл бұрын
i don't see anything preventing question #2 from working, u just gotta steal the signal going from the buttons to arduino #1 and connect it to the pins of arduino #2 (NOTE: i am an electronics and arduino noob, please keep that in mind)
@adriansfx
@adriansfx Жыл бұрын
as for #1 you can, a lot of the custom keyboards out there are based on this little board, and as a matter of fact you can even send up to F24 even tho traditional keebs go just up to F12
@drakelazerus
@drakelazerus 8 ай бұрын
Thanks so much! Built a 4 key and using your code I can enter stored passwords with the click of a button. I am curious if you would know how to have it enter a string then do a tab and then enter another string and then have it do an enter? I want to have this enter a username then do a tab and then enter a password and then do an enter? All of this programmed on one button press.
@Kwistenbiebel100-ns5ko
@Kwistenbiebel100-ns5ko 7 ай бұрын
Does this behave like a real keyboard if you hold a key down? Multiple characters are being put out?
@bratban919
@bratban919 Жыл бұрын
I have been trying to get my pro micro to work but I get "averdude" messages and cant get my board to work. Any tips?
@054-manikandabharathi.t5
@054-manikandabharathi.t5 2 жыл бұрын
Is it possible with esp32
@AvitoBot
@AvitoBot Жыл бұрын
Вопрос: можно ли применить это к другим микроконтроллерам?
@SimpleElectronics
@SimpleElectronics Жыл бұрын
Only those that have HID capability - the RP2040 for example has it but the ATMega328p does not
@AvitoBot
@AvitoBot Жыл бұрын
@@SimpleElectronics извиняюсь, а на esp32 не получится?
@Zacharyjones8751
@Zacharyjones8751 4 ай бұрын
how do you do every pin
@williamfraser
@williamfraser 11 ай бұрын
If you had eight buttons, could it combine the inputs and decode the "binary" string? For example, pressing buttons two and eight (counting from left) gives 01000001 and translates to "A".
@BrightBlueJim
@BrightBlueJim 10 ай бұрын
Or you could use a single button, and make the user enter the characters in Morse code.
@whocares1433
@whocares1433 2 жыл бұрын
Cool, there is a way to manipulate the arrows of the keyboard?
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
I think so actually - check out the linked website!
@muhammadaniqzakwan2d416
@muhammadaniqzakwan2d416 11 ай бұрын
Question, can the board be swap with a standard breadboard?
@liamjoseph992
@liamjoseph992 Жыл бұрын
Can this be made into a wireless/Bluetooth device. And battery powered?
@allnewgames6221
@allnewgames6221 5 ай бұрын
Does this work with arduino uno or esp 32
@RobertDMercado
@RobertDMercado 5 ай бұрын
No, they use a entirely different microcontroller
@jorgesaul2280
@jorgesaul2280 2 ай бұрын
Donde te contacto ouedo pagarte ocupo ayuda con un codigo . . Ya esta funcionan peeo quiero añadir una tecla en especial y no eh podido .
@LowTierDev-1
@LowTierDev-1 6 ай бұрын
Can the uno do it?
@SimpleElectronics
@SimpleElectronics 6 ай бұрын
No you need a micro with a ATMEGA32u4
@edsonferraz1
@edsonferraz1 Жыл бұрын
Very good your video, congratulation!! Is possible make a codigo to press FN + F6 how example
@mahirdaiyan6898
@mahirdaiyan6898 9 ай бұрын
Can we do it with a Arduino Uno?
@GaryGrimtooth
@GaryGrimtooth Жыл бұрын
Does it trigger a LLHKF_INJECTED flag from windows when you send mouse clicks?
@NoOne.--_.--..._--_..l--l
@NoOne.--_.--..._--_..l--l Жыл бұрын
Can we use every digital and analog pins?
@NREYTERYREYTY5fddffsfdf
@NREYTERYREYTY5fddffsfdf 2 жыл бұрын
dude this is great I'm gonna use this to make a flight panel for Microsoft flight simulator
@g1expert102
@g1expert102 Жыл бұрын
I want to use this for a control panel for games... Ill be using in for stormworks It will have your basic push button but i also want to use circuit breakers
@loukxo
@loukxo Жыл бұрын
Hi, you didn't have any problems with the inclusion of the keyboard library? I did a little, that's why I'm asking, since it's only been a month since you posted this message ...
@g1expert102
@g1expert102 Жыл бұрын
@@loukxo if you use the arduino leonardo then you don't need to struggle with it. You simply just type include keyboard.h
@tsumplays4185
@tsumplays4185 Жыл бұрын
Not sure if this comment will be seen but, can I ask if you had to download any drivers for your pro micro? Mine seems to have a 'unknown USB device' error, and it seems like I don't have a driver installed for it
@jeremy6384
@jeremy6384 Жыл бұрын
can the 32u4 handle multi press? ie can I do any combination of keyboard characters simultaneously?
@MogensBeltoft
@MogensBeltoft 2 ай бұрын
It depends on how the USB HID report is made, but most implementations I have seen can handle 6 simultaneous key presses. But your code needs to support this too. You can't have delay() calls when you have to detect multiple key presses.
@jokerzbp9545
@jokerzbp9545 Жыл бұрын
But what I'm seeing from this code is that you cannot hold down a key. I could be wrong but if I wanted to walk using WASD I probably couldn't. I bought a metal DDR pad and the control box isn't working so i wanted to make my own JoyToKey after seeing how the pad worked.
@onecircuit-as
@onecircuit-as 2 жыл бұрын
Nice vid! 😀👍
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
Thanks man!
@os-channel
@os-channel 2 жыл бұрын
Great thing, thank you!
@paddyh4272
@paddyh4272 Жыл бұрын
I need something like this but I need it to use 18 keys from a keyboard for a custom panel. Which is best Arduino board to use?
@CobraFat2000
@CobraFat2000 Жыл бұрын
I think you can probably use the same one as in video, but you'd need to explore making a grid- like with 12 digital inputs - wire them 6 horizontal and 6 vertical and check against pairs of pulled pins for inputs and you'd have 36 - maybe even 4x4x4 for 64 or 3x3x3x3 is a possibility for a full blown 81 inputs, but it will probably limit how many keys can be pressed at the same time - depends on application of the product you're working on.
@electroniquepassion
@electroniquepassion 2 жыл бұрын
Salut, il n’est pas recommandé de mettre un filtre devant les leds ? Car je crois que cette lumière n’est pas bonne pour les yeux ! Sinon beau projet 👍 à bientôt 👋
@SimpleElectronics
@SimpleElectronics 2 жыл бұрын
Je crois qu'ils sont correcte - ils n'ont pas beaucoup de lumière infrarouge ou ultraviolette!
@electroniquepassion
@electroniquepassion 2 жыл бұрын
@@SimpleElectronics Ok d’accord 👍 bonne continuation
@DNF07
@DNF07 Жыл бұрын
Bro can i use ot for games instead of W A. S D
@georgef7754
@georgef7754 2 жыл бұрын
A keyboard project will be very interesting.
@AlexandreNOliveira
@AlexandreNOliveira 10 ай бұрын
Hi, thank you for this content. Straight to the point. A quick question: After see your video and others about using ATMega32U4 as a keyboard, still not clear to me if it need to be the one of 3.3V or the one of 5V. Could you kindly let me know the correct voltage? Thanks in advance!
@SimpleElectronics
@SimpleElectronics 10 ай бұрын
If you are going to plug it into usb, best to use the 5v version, simplifies a lot of stuff
@AlexandreNOliveira
@AlexandreNOliveira 10 ай бұрын
@@SimpleElectronics Thank very much for your comment!
@RixtronixLAB
@RixtronixLAB Жыл бұрын
Nice video, well done, thanks for sharing :)
@armanabbasi4384
@armanabbasi4384 4 ай бұрын
I really appreciate it
@tallnrough68
@tallnrough68 Жыл бұрын
How would I make a switch open a program on my computer ?
@hoople212
@hoople212 Жыл бұрын
could use [Windows]+r command to open run, then enter the appropriate command followed by enter?
@_BangDroid_
@_BangDroid_ Жыл бұрын
Depends on what program you want to launch. Some applications can be opened using the Application Launch keycodes as part of the USB HID standard, these include Web browser, calculator, email client. Unfortunately the library used here doesn't support the full USB HID standard which means media keys and application launch keys are not possible. You could set the keys to be something obscure like F13 - F24 and use AutoHotHey to detect and run various commands, like opening an application. Otherwise, use a different library which does have full functionality, like NicoHood's HID project.
@FPChris
@FPChris Жыл бұрын
Can you send Ctrl+Key or Middle Mouse Button + Key?
@BrightBlueJim
@BrightBlueJim 10 ай бұрын
Yes! Since there are functions to call for all keyboard and mouse activities, you can certainly send codes that combine mouse and keyboard actions. The SparkFun tutorial that he based this project on (see the link in the description) gives more information about things like separate press and key actions for the keyboard, which lets you simulate holding down the Ctrl key and clicking the mouse center button, then releasing the Ctrl key.
@ashfaqjuna
@ashfaqjuna 2 жыл бұрын
05:29.. ok ok I have subscribed! :) Great video. Thanks 👍
@bluemuffin6160
@bluemuffin6160 Жыл бұрын
How is this when compared to using QMK?
@BrightBlueJim
@BrightBlueJim 10 ай бұрын
QMK probably started out as a project much like this. QMK is much more sophisticated in how it lets you define how every key behaves, but when it's running, it's doing very much the same thing.
@YigalBZ
@YigalBZ Жыл бұрын
Great video. Would it work with other Arduinos? ESP32?
@mak.6516
@mak.6516 6 ай бұрын
ESP32 support HID via bluetooth
@vanchien5874
@vanchien5874 2 жыл бұрын
Hi, does it work for only windows? I want to simulate a mouse using this in linux. Is it possible?
@BrightBlueJim
@BrightBlueJim 10 ай бұрын
Since Human Interface Device (HID) class devices are generic, they should work equally well in Windows, MacOS, or Linux. These all use the same standards, although some keys are labeled differently on Macs. There's nothing Windows-specific in this project.
@khefer1980
@khefer1980 Жыл бұрын
Can You sent compination of Ctrl+C / Ctrl+V ;-)??
@CobraFat2000
@CobraFat2000 Жыл бұрын
You could always try something like: Keyboard.press(KEY_LEFT_CTRL); Keyboard.write('c'); Keyboard.release(KEY_LEFT_CTRL);
@DNF07
@DNF07 Жыл бұрын
Hello bro can any one tell me how to make joystick for keyboard with this plz help
@BrightBlueJim
@BrightBlueJim 10 ай бұрын
If you look at the SparkFun tutorial linked in the description, which is what this project was based on, it gives an example of using an analog joystick to act as a mouse. That should be helpful.
@K0BRAKID
@K0BRAKID 4 ай бұрын
Would this work with a Mac?
@MogensBeltoft
@MogensBeltoft 2 ай бұрын
Yes, a HID keyboard is supported by both Linux, Windows and Mac.
@elektron2kim666
@elektron2kim666 11 ай бұрын
With a touch keyboard on the micro's display this would make sense.
@vidyaaji6086
@vidyaaji6086 3 ай бұрын
Bro would this code work on arduino uno
@void-h2n
@void-h2n 3 ай бұрын
Oke I’m a novice but I think it should, you’d have to change the board in the menu and adjust the pins but…. It should work idk tho
@MogensBeltoft
@MogensBeltoft 2 ай бұрын
The Arduino Uno's ATmega328P can't do this unless you replace the firmware/bootloader on it.
@OfflineEz
@OfflineEz Жыл бұрын
Do I need diodes or resistors in this or could I just plug a keyswitch directly too my digital input and ground? im assuming the arduino I wanna buy has resistors built in it
@frankowalker4662
@frankowalker4662 2 жыл бұрын
That's nifty.
@evdokimovm
@evdokimovm 11 ай бұрын
That's the kind of "firmware", not the HID driver, am I right? I mean, when someone has soldered a custom keyboard, let's say, using an Arduino Nano, there is already a universal HID driver in the OS, but to make the output of the buttons correspond to symbols, you need to write a kind of "firmware", as shown in the video?
@SimpleElectronics
@SimpleElectronics 11 ай бұрын
That's my understanding
@selectnull4459
@selectnull4459 2 жыл бұрын
I just knew you will press the E switch for Subscribe many many times :) - hope its an odd number of times :)
@SFoX-On-Air
@SFoX-On-Air Жыл бұрын
thats basically the way to make a rubber ducky ^^
@rickharold7884
@rickharold7884 2 жыл бұрын
Cool
@doougle
@doougle 2 жыл бұрын
That's neat. If you knew a twitch streamer you could probably make a little device to fire commands and macros. verowaThink It seems like you could also fashion a customized game controller if the latency isn't bad.
@koolkidthergamer800
@koolkidthergamer800 Жыл бұрын
Thanks for the tutorial now i can make a password keyboard
@jlr3636
@jlr3636 11 ай бұрын
Nice, so I’m left handed, now I can build a Number Keypad which I can place on the left side of my keyboard so I don’t have to reach across to operate my keypad. Using programs such as Blender, I mouse with my right hand and type with my left hand, this will speed up the work-flow. Purchasing a dedicated left hand keyboard cost hundreds,
@edran4449
@edran4449 6 ай бұрын
i tried this kept having problems with library, spent a good hour trying to troubleshoot code to look for any mistakes, searched it turns out arduino uno does support this library, sadly it doesn't have that chip, welp that was sadly painful guess ill need to buy an arduino with that chip, lmao i thought all arduino was the same just different sizes. guess its back to aliexpress for that chip arduino hahahaha.
@Hoekstes
@Hoekstes Жыл бұрын
I bought a nano for this project 🤦🏻‍♂️
@CraftyUnknown
@CraftyUnknown Жыл бұрын
which one do you need?
@Hoekstes
@Hoekstes Жыл бұрын
@@CraftyUnknown you need the Leonardo, but luckily I found a workaround to make the Nano do what I wanted. Edit: The Leonardo has HID (human interface device) capabilities that the Nano doesn’t.
USB клавиатура и мышка на обычной Arduino Nano! EasyHID ч.1
8:03
Заметки Ардуинщика
Рет қаралды 172 М.
Turn your ESP8266 into a USB Keyboard and Mouse - Easy Tutorial
6:37
Maker's Fun Duck
Рет қаралды 34 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Transform an old broken Keyboard to a Macro Keyboard
8:11
NerdCave
Рет қаралды 63 М.
How to FIX a BRICKED Arduino Pro Micro
14:24
Stuart Patterson
Рет қаралды 3,5 М.
The SMOOTHEST Macro Pad EVER! - Arduino 4x4 USB Macro Pad
16:04
Simple Electronics
Рет қаралды 16 М.
Make Dumb Electronics Smart for $3
13:13
I Like To Make Stuff
Рет қаралды 815 М.
How does a USB keyboard work?
34:15
Ben Eater
Рет қаралды 3,3 МЛН
How I Built A LEGO Treadmill That Moves In EVERY Direction
18:06
Banana Gear Studios
Рет қаралды 1,1 МЛН
Американцы красят асфальт?
0:27
BAZAR CLUB
Рет қаралды 188 М.
НИКОГДА не иди на сделку с сестрой!
0:11
Даша Боровик
Рет қаралды 729 М.
Robot 🤖 cleaning 🧹
0:57
Bunnal 𝚃𝚎𝚌𝚑
Рет қаралды 4,7 МЛН
#trending #foryou #challenge #fyp #viral #short #tiktok #vs
0:15
Misiсatсh
Рет қаралды 2,4 МЛН
Самые простые строительные леса
0:54
Канал ИДЕЙ
Рет қаралды 1 МЛН