Это видео недоступно.
Сожалеем об этом.
🔴 Fast, cheap, simple: DIY USB foot pedal (keyboard) for teleprompter, programming, gaming
HTML-код
- Опубликовано: 15 мар 2018
- I will show you how to make a cheap USB keyboard / USB foot pedal. I use it for shortcuts while programming and to control the teleprompter. We will use Arduino pro micro and make use of its USB port. I will show schematics, hardware and software. Software is free to use (github link below). DIY Arduino project for beginners.
ATmega32U4:
32kB flash
2.5kB RAM
1kB EEPROM
16MIPS at 16MHz
USB 2.0 port
2.7-5.5V
---------------------------------------------------------------------------------------------------------------------
Do you like my work?
1. Hit LIKE.
2. Hit SUBSCRIBE! Did you consider subscribing to my youtube channel and being updated when new videos are published?
3. COMMENT below.
4. SHARE.
5. Support my work on Patreon: / greeneyedexplorer
6. You can also donate directly to me via: paypal.me/rokrodic
7. Buying through my affiliate links makes you no additional cost, but gives me a small headstart in getting new things for my explorations.
---------------------------------------------------------------------------------------------------------------------
LINKS:
GreenEyedExplorer homepage: www.rodic.si
GreenEyedExplorer Thingiverse: goo.gl/jdyHbF
GreenEyedExplorer GitHub: goo.gl/XtjB3h
Songs in the background: Silent Partner - Come On In, Topher Mohr and Alex Elena - Where I am From, RUclips Audio Library.
I think I never found a tutorial project so close to perfection: simple, clear, concise and precise, both in content and detail. You have my gratitude.
Thank you!!!
Th is, I’ll maybe gonna try it
Word like a charm and it easy to edit the code and add keys. Thank you alot sir. Im using it for a guitar foot switch.
You are welcome. I am glad.
Hi all. Quick update. I managed to do it in a more simplified script. This video was inspirational to get me started and I am very thankful for all your replies to my queries. See code below whci I modified from another video off youtube. In the last few lines Keyboard.press is used for triggering (KEY_LEFT_ALT) because Keyboard.press is used when other keys will be used in conjunction with say for example Ctrl key etc ... in this case I needed to press two keys. The Alt and S key. So I used Keyboard.press for the Alt key and used Keyboard.write for the S key. I had to use Keyboard.release after to stop both keys.
}
//---------------------------------------------------------
// Loop
//---------------------------------------------------------
void loop() {
Keyboard.begin(); //begin keyboard
if (digitalRead(7) == 0) // if button 7 is pushed
{
Keyboard.write((char)0x20); // press space bar
delay(200); // delay so you don't get 20 spacebar presses
}
else if (digitalRead(5) == 0){ // if button 5 is pressed
Keyboard.write(KEY_DOWN_ARROW); // press Down arrow key
delay(200);
}
else if (digitalRead(3) == 0){ //if button 3 is pressed
Keyboard.write(KEY_UP_ARROW); // press up arrow key
delay(200);
}
else if (digitalRead(8) == 0){ //if button 8 is pressed
Keyboard.press(KEY_LEFT_ALT);delay(200); // press up alt key
Keyboard.write ('S'); delay(200);
Keyboard.release ('S');
Keyboard.release (KEY_LEFT_ALT); //Press s
}
Keyboard.end(); //stops keyboard
}
Great. I am now working on new projects and new videos by now... Electric trike, arduino autonomous lawn mower... so my mind is set elsewhere at the moment :-)
I need for my little gigs an usb foot controller to easy control the backing tracks from my computer: previous track, play/stop, next track. this is what I'm looking for. love U
You are welcome. Happy holidays and new year.
Perfect for this Quarantine. Great video!
Thank you!
this is what im looking for, thanks
Going to try & make a footswitch to use in rocksmith.
I am not familiar with programming usb in Arduino, can you program shortcuts with multiple keys (i.e. Ctrl + V)?
Hi. Yes you can. Just combine/send ctrl and V.
Hi. Could anybody please provide me with another link for the code as the link in the video doesn't work for me. Thanks
Hi. Check github.com/rokrodic/USB-Keyboard
Hi, I found this video and it´s exactly what I want.
I´m trying it with Arduino mega an I got this message:
C:\Users\aitor\Desktop\USB-Keyboard-master\USBKeyboard\USBKeyboard.ino:11:10: fatal error: Bounce2.h: No such file or directory
#include "Bounce2.h"
^~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: Bounce2.h: No such file or directory
Can you help me?
Hi. Search for bounce2 arduino library on the net. Put .h and .cpp or .C files in the same folder as my files.
I was testing the project with Arduino uno and then I read that it is only compatible with the Atmega32u4
I have already bought an ATmega32U4
Thank you
Sir you just made my day, thanks and keep up the good work
Thank you for your support. I am glad I can help!
Thank you for sharing
So it means, every teleprompter Apps that has bluetooth functions,your DIY Foot pedal can support? if so thank you, I found an app that converts and mirror-flip powerpoint slides for iPad and immediate use the iPad with my slides flipped in prompter ,therefore I need a bluetooth pedal keyboard to switch my slides when reading my scripts. is that possible?
Hi. It is an USB keyboard. Arduino code emulates USB keyboard. I have not tried making a bluetooth one... My keyboard emulator works via cable only. I use 5m long USB cable (ethernet cable with USB jacks at the ends)...
@@greeneyedexplorer Ok,Sir I appreciate your time to reply back... best wishes to you
@@delftsurgery4258 It is possible. Much harder project, though.
Hello! It is possible to make this foot switch but instead of assigning keyboard keys , assign midi ?
To use it as a midi controller on a daw
Sure. You can fly to the moon if you want. Is it: www.arduino.cc/reference/en/libraries/usbmidi/
... just search "arduino midi library" on google...
What is the latency for this setup? I have RSI but still want to play competitive FPS (will be using it for aim/fire button)
It is fast, but the slowest is button press detection if you want it to be precise...
thanks for share~
well done.
Hello buddy, I would like to build almost same footswitch you built, im musician and sometimes I use power point to read songs during im playing so I have no choice to use my foot for change slides, it is possible to make a footswitch that allows me to go next and previous slide and the third button for select? Thanks
Yes. Just use right codes for up/down or space/backspace for your PowerPoint and use them. Usualy space or right arrow key is for next Page and left arrow key for back. Try this combo...
Thank you so much for the tutorial. I have a question, when I assign a key to a pin (switch) and close it, it ends up sending the key multiple times, even if the switch was only pressed for one second.. Is there a way to make it only send it only one time as long as the switch is held down and only send it again when the switched is released then pressed again...etc.? The reason I ask is I'm trying to assign CTRL-Z to undo an action, and how it's currently set up the undo command gets sent multiple times :) Thanks!
Hi. Thank you. It can be done this way: use debounce for both keypress and release.
I have not done any programming w/ these chips but was wondering if a single key can activate some code ("key press" equivalent) on KEY DOWN and then automatically enters a DIFFERENT code on release of the key ("key up" action). Thanks for any input.
Hi. Sure. It can be done. Sky is the limit. Just check for pin state change on keypress, send anything you want and then check for the keyrelease and send other stuff you want...
thank you for this information. I haven't tried to do anything yet, but having this input from you gives me some ideas. Thanks again.
Hello, what kind of wires should I be using for this project? Thank you for the video!
Hi. Any isolated wire. All are fine. Currents are in milliampere range.
Thanks a lot for this tutorial. In my case, I need it to use a single pedal (space bar) to start the music while I play my instrument.
Question: The switch has three pins, one is ground, but what about the other two? It's the same what I use?
Hi! Thanks for the question. Switch switches one pin of the connector between the other two pins. You do not need a switch. Use a push button which returns to a non pressed state after the release...
@@greeneyedexplorer Thanks a lot for the answer. That's a shame because I have a very nice pedal switch and it's really comfortable. Can I not use it for this purpose?
Sure, you can use it. Try with .fell() as in example...
@@greeneyedexplorer I will not do the programming (I leave that task to someone else), I would like to now how to connect the three pins switch to the Arduino, if possible.
If using my code in short, one pin of the switch to chip, the other to ground. When pressed, switch should shorten the connection...
Great video. How do you do CONTROL + Arrow?
Hi. Please check my answer to Srdan below....
Very nice. Which (momentary, I assume) foot switches did you use for this?
Hi. They are ordinarily push buttons (momentary) as you have assumed correctly. So, no toggle switches. This device helps me a lot when recording videos... Thanks for the question and viewing my video.
Very nice bro, i would like to make a footswitch for the enter key, how can i make it, i am new arduinoer.
Hello, can you also send multiple keys on one button press, like CTRL+ALT+Z, or arduino can send only one key per button press?
Hi. It can send combinations. Example, try:
// CTRL-ALT-DEL: Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press(KEY_LEFT_ALT);
Keyboard.press(KEY_DELETE);
delay(100);
Keyboard.releaseAll()
Please check www.arduino.cc/en/Reference/KeyboardModifiers
You should also check the Keyboard.cpp. See how it sends character modifiers.
Thanks for the help. And im guessing this wojld work also on the arduino nano?
Sadly no. FT232 on Arduino Nano works as USB to serial converter and is recognised as such on operating system. In order for it to work in a such way you would have to write your own drivers for the operating system...
Ah thats a shame... writing drivers is surtanly out of the question :))) thabks again ill order the bord now
Yes, it is better to go the easiest way. Don't forget to subscribe, share and click like :-)
Is there any way to do the same via Bluetooth?
Unfortunately I am getting the error "Bounce does not name a type" ... not sure why.
Bounce2 files (.h and .cpp) should be in the same folder as .ino file. Than it compiles. Arduino moves just .ino file in its own folder (same name as .ino file), but does not move bounce2 files...
@@greeneyedexplorer Somehow, the arduino micro has been bricked and now the port is greyed out. I have tried everything in vain. I ordered an arduino leonardo as these micro boards seem very finicky.
Sorry to hear that. Meanwhile you can read the comments below as someone developed code further. Maybe it gives you new ideas...
@@greeneyedexplorer Hello. I bought an arduino leonardo and it works perfectly. One quick question though. I need to add an extra button on pin 8. This button would act as if I am pressing ALT+S. How would I go about modifying the code for that please?
I think this should work: first send KEY_LEFT_ALT, then send "S". See Keyboard.h
Can I use this like a midi controller?
Yes, if it uses an usb keyboard as a controller.
Thanks for your info. Ill see in 30 days time what i can make of it when the arduinos arrive.
Im wonder can you program the arduino to see what app is running and to have the button do different thing depening on what app is runing?
No. Arduino just emulates the keyboard. In order to achieve your goal, you would have to find a program on the net which would do these program detection things and keypress rearrangements...
Zdravo :) dobil sem arduinota in sem uporabil tvojo skripto za komando if (val3==LOW) { Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_LEFT_ALT); Keyboard.press(121); delay(200); Keyboard.releaseAll(); } in ko stisnem gumb v windowsih pošlje komando 2x, kako se nastavi da pošlje samo 1x?
Poizkusi še z dodatkom "delay(1000);" za releaseAll() komando. To bi moralo delovati.
to pa deluje :) hvala, čakam še enkoderje da pridejo po pošti če bom še kj rabu te bom pognjavu :)
No problem. Just ask!!!
Do you have a video of your diy teleprompter?
Hi. Good idea for a new video.
@@greeneyedexplorer I really would like to see how you made it, also if you decide to adapt your keyboard to a bluetooth version I think many people will see the video