Hi all,
I'm trying to look into using a mini usb host shield with my pro micro in order to send a modifier key press while I press a key on the keyboard connected to the usb host shield. For example, sending the key CTRL down automatically while I press a key on the keyboard attached to the usb host shield.
I was able to do that with a button but am now trying to do it with a prebuilt keyboard.
Keyboard.press(128);
Keyboard.print(key);
Keyboard.release(128);
I can't really find much information on working with the mini usb host shield though. Could any of y'all post links to where I could learn more about setting up the mini host shield with the pro micro and some beginner scripts?
Thanks!
Are You posting from the world of ghosts? "Hold down a modifier".....
Step out of Your private sphere and use explanations possible to understand for this community.
Hi, thanks for replying! Oh ok sorry for not explaining it correctly.
I'd like the code to send a key press before every keystroke I make on the external keyboard and a key release after each one as well.
I've done this with a button connected to a pro micro but am trying to do this with an already prebuilt keyboard. For example, here is my code for holding down the CTRL key while pressing a key I send to a function.
Keyboard.press(128);
Keyboard.print(key);
Keyboard.release(128);
Any tips on doing this would be really appreciated!
But any links or scripts for people beginning to use a mini usb host shield with a pro micro would be great as well.
Send from where?
Word sallad is way too often unclear.
Know that every helper is a complete newbie to Your project.
I have been practising christal ball reading but I don't feel it's the proper tool here in forum.
Try making a drawing of the blocks involved and post it here.
Whenever I press a key on the keyboard attached to the usb host shield, I'd like the arduino pro micro to send a "CTRL" key press down before sending the keystroke I hit on the keyboard. Then I'd like a "CTRL" key release after the keystroke.
For example if I press the "C" key on the keyboard attached to the usb host shield, I'd like the computer to think I'm pressing "CTRL + C". I will change "CTRL" to something else later on but this is basically what I'm looking for.
What USB Host Shield library are you using? Does it have a keyboard example? Can you use that example to get keystrokes from your USB keyboard?
Thanks for replying John! I believe I'd be using this library: "USB Host Shield Library 2.0." I'm trying to look for more information on using the mini usb host shield https://www.amazon.com/gp/product/B01EWW9R1E/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
but I can mainly only find other forum questions on google.
Good idea about using a keyboard example, but not really being able to find one I know would work. Do you have any suggestions for example code for the mini usb host shield?
I found this but I'm not sure about it. https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino
Any recommendations for information regarding this device would be appreciated!
I've been doing some research and am getting confused on some things. Can the mini usb host shield work with a 5v pro micro? (I think it's 5v since it has 16MHz on it) Or does it need a 3.3v one? I feel like it's hard to find info on this device for some reason.
It will either work or not. Give it a try.
Yeah good point. Do you know if it's ok to use a 5v pro micro with it though? I don't want to mess it up or anything.
The mini USB host board runs at 3.3V logic levels so it is best to use a 3.3V/8 MHz Pro Micro. The board was designed to fit on a Pro Mini (Mini != Micro) but it can be used with the Pro Micro but some extra re-wiring. SparkFun sells 3.3V Pro Micros but I have never seen a cheap clone 3.3V Pro Micro.
The next website is/was run by one of the creators of the Arduino USB host shield library. It used to be circuitsathome dot com but the domain is now owned by a different company.
https://chome.nerpa.tech/arduino_usb_host_shield_projects/
Oh ok great, thanks for the info! Even though the usb host shield was designed for the pro Mini, the pins would correspond with the pins on the pro micro? Anyway great link! Will definitely go through it
More information but I cannot vouch for the info. I don't have time to read this stuff. I have not used USB host in years.
https://yaowei.dev/posts/usb-to-usb-converter/