This project will show how can you use an USB enabled Arduino as a USB Keyboard.
I will not explain how it works from the silicon. That will be a book one it self.
Like Arduino micro, Arduino Leonardo etc.
You can make an entire keyboard if you want.
2. 4 Push Buttons
3. Some wires
1. Setup the circuit as shown in the diagram above with the breadboard wires.
3. Click the Upload button to send this code to your Arduino.
4. Wait for to upload to finished then reconnect the Arduino by unplugging the USB cable and re-plugging.
5. Now open "Notepad" app in your PC/MAC.
6. Push one of those button, you will see the character in the app.
Here you can see when i press tthe buttons it sends the character to the PC.
This one will send 'A', 'B', 'C', 'D' character to PC/Mac.
This one will send Up, Down, Left, Right command to PC/Mac. You can try this in a game or website.
2. You can also use other spacial keys from this list here.
3. You can make a custom Keyboard to suit your needs. Like Video editing or Photoshop shorcuts in a keyboard.
2. Select the proper board from the "Tools">> "Boards" . Or you will get error when you tried to build the code.
3. It will register/handles one button at a time. Because the code dose not supports multi pal registering key. Means if you press all of those buttons at a time it will not send all of those one time.
4. Make sure there is no loose connection and Use a good USB cable.
Thanks.
I will not explain how it works from the silicon. That will be a book one it self.
So What is "USB enabled Arduino" ?
Not all Arduino can act as a USB Keyboard. Usually those board has Atmel-Mega32U4 MicroControlar can act as one. Those chip have HID support.Like Arduino micro, Arduino Leonardo etc.
You can make an entire keyboard if you want.
What you need?
1. Arduino Micro/ Leonardo.2. 4 Push Buttons
3. Some wires
Schematics
Wire up your parts according to the diagram And connect the Arduino to your PC/Mac.Code
This is a simple code that will send some English character to a computer.1. Setup the circuit as shown in the diagram above with the breadboard wires.
2. Now Plug the Arduino to your PC/Mac with USB cable.
3. Click the Upload button to send this code to your Arduino.
4. Wait for to upload to finished then reconnect the Arduino by unplugging the USB cable and re-plugging.
5. Now open "Notepad" app in your PC/MAC.
6. Push one of those button, you will see the character in the app.
Here you can see when i press tthe buttons it sends the character to the PC.
This one will send 'A', 'B', 'C', 'D' character to PC/Mac.
#include <Keyboard.h> // This is a "built-in" library so no need to install from outside void setup() { pinMode(2,INPUT_PULLUP); // sets pin 3 to input pinMode(3,INPUT_PULLUP); // sets pin 4 to input pinMode(5,INPUT_PULLUP); // sets pin 3 to input pinMode(6,INPUT_PULLUP); // sets pin 4 to input } void loop() { Keyboard.begin(); //First begin keyboard if (digitalRead(2) == 0 ) // if buton 2 is pushed { Keyboard.write('A'); // send single character "A" delay(200); // delay to don't get 5 A's } if (digitalRead(3) == 0 ) // if buton 3 is pushed { Keyboard.write('B'); // send single character "B" delay(200); // delay to don't get 5 B's } if (digitalRead(5) == 0 ) // if buton 5 is pushed { Keyboard.write('C'); // send single character "C" delay(200); // delay to don't get 5 C's } if (digitalRead(6) == 0 ) // if buton 6 is pushed { Keyboard.write('D'); // send single character "D" delay(200); // delay to don't get 5 D's } Keyboard.end(); // stops keybord }
This one will send Up, Down, Left, Right command to PC/Mac. You can try this in a game or website.
#include <Keyboard.h> // This is a "built-in" library so no need to install from outside void setup() { pinMode(2,INPUT_PULLUP); // sets pin 3 to input pinMode(3,INPUT_PULLUP); // sets pin 4 to input pinMode(5,INPUT_PULLUP); // sets pin 3 to input pinMode(6,INPUT_PULLUP); // sets pin 4 to input } void loop() { Keyboard.begin(); //First begin keyboard if (digitalRead(2) == 0 ) // if buton 2 is pushed { Keyboard.write(KEY_UP_ARROW); delay(200); } if (digitalRead(3) == 0 ) // if buton 3 is pushed { Keyboard.write(KEY_DOWN_ARROW); delay(200); } if (digitalRead(5) == 0 ) // if buton 5 is pushed { Keyboard.write(KEY_LEFT_ARROW); delay(200); } if (digitalRead(6) == 0 ) // if buton 6 is pushed { Keyboard.write(KEY_RIGHT_ARROW); delay(200); } Keyboard.end(); // stops keybord }
Conclusion
1. You can send any character you want in this list from 1st to 128th. Other can't because the keyboard library dose not supports others.2. You can also use other spacial keys from this list here.
3. You can make a custom Keyboard to suit your needs. Like Video editing or Photoshop shorcuts in a keyboard.
N.T.
1. Download the library first from "Tools">> "Manage Libraries..">> "Keyboard Buit-In by Arduino ">> Click the install.2. Select the proper board from the "Tools">> "Boards" . Or you will get error when you tried to build the code.
3. It will register/handles one button at a time. Because the code dose not supports multi pal registering key. Means if you press all of those buttons at a time it will not send all of those one time.
4. Make sure there is no loose connection and Use a good USB cable.
Thanks.
I got what you mean , a debt of gratitude is in order for posting .Woh I am cheerful to discover this site through google.
ReplyDeleteAccess control solutions
Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. best programming chair
ReplyDeletePrior to leaping to that end, why not go through the following five minutes of your life perusing what precisely is an ergonomic keyboard. mk270 keyword reviews
ReplyDeleteThis was really an interesting topic and I kinda agree with what you have mentioned here! game
ReplyDeleteYou should pick up a soldering iron with at least 30 watts of power. Soldering irons with low wattage take longer to heat up and are not consistent holding the temperature. Know more about Hakko brand.
ReplyDeleteMedical keyboards must be designed to accommodate the rigors of a healthcare environment. Hospitals often have significantly higher levels of radio interference due to the numerous medical devices that are deployed in combination with IT equipment. Seal Shield Medical keyboards have double shielded cables that exceed USB spec and include additional cable ferrites to eliminate radio frequency cross-talk. Flat
ReplyDeleteI was more than happy to uncover this great site. I need to thank you for your time due to this fantastic read!!
ReplyDeleteI definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
humidifier dehumidifier combo
I was more than happy to uncover this great site. I need to thank you for your time due to this fantastic read!!
ReplyDeleteI definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
WordPress Chat Plugin
Really fascinating info, really worth suggesting. Nevertheless, I suggest this particular: תכנות לילדים
ReplyDeleteDell has an assortment of pink laptops for the fashionista in you. They much offer what is considered their Promise laptop that assists battle with breasting malignancy. CPS Test
ReplyDeleteThe information in the blog you posted here is useful because it contains some of the best information about Magnetic Bead Separation available. Thanks for sharing it. Keep up the good work.
ReplyDeleteThanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. Proteus Library for Arduino
ReplyDeleteYour texts on this subject are correct, see how I wrote this site is really very good. Satta king 786
ReplyDeleteWe love learning about the clients these people mark are all essential and play substantial functions within our procedure. web design and marketing company
ReplyDeleteIt is quite beneficial, although think about the facts when it reaches this target. Black satta king
ReplyDeleteZero in on the benefit
ReplyDeleteThe principal issue you wish to focus on though partaking in the Satta King 786 games is to procure a huge benefit. You should chase after the Satta assortment that includes a high probability of winning. Maybe then your fortunate assortment. There are different Satta games possible. Anyway if you are endeavoring to play each Satta King, you would perhaps not be prepared to dominate any match. Notwithstanding, if you participate in one Satta King 786, the potential outcomes of winning are overstated.
The click per second is initiated the same way as the other modes of the play like - clicks in 5 seconds, or 10 seconds or 60 seconds, but in the 1-second game the players have to be on their toes and start hitting the mouse at one breath. On average, most players would easily score between 8-10 clicks per second
ReplyDeleteclick here
With the right information and tools Bitcoin mining is not only rewarding, it's also a fun and safe way to transfer money across the internet. To make as much money as possible you need to have the right software and powerful computer hardware. fake bitcoin sender
ReplyDeleteThanks for sharing. visit our website and check guide of how to program cox remote samsung tv
ReplyDeleteIt's really a good blog kindly thank you for sharing this.
ReplyDelete3D Scanning Services Near Me
3D Scanning Reverse Engineering
Reverse Engineering Services
Plant Engineering Services
Offshore Engineering Services India
This blog is really good... keep sharing such amazing posts with us.
ReplyDeleteIf you guys are looking for the best and most cost-effective data migration services, master data management services, data integration services, and need advice for sap data management, you can contact our data analysis expert team. They will help you out with all your data concerns. Get in touch with them from - https://gluedata.com/
If you need help with your account or just have any other questions about QuickBooks, all you have to do is dial Quickbooks Customer Support Phone Number+1 888-210-4052.
ReplyDeleteThanks for sharing such amazing content. Really loved to read such content. Keep posting such content in future as well. India assignment help
ReplyDeleteThe toll free number is Quickbooks Support Phone Number +1 888-210-4052 and you need to dial that number for your queries and errors issues.
ReplyDeletevery nice information please have loo at this how to check zong balance
ReplyDeleteNice Blog Sir, Its Very Helpful for me. Good Job & Keep it up.
ReplyDeleteIntraday Trading Tips Share Market Expert Advisory Sharetipsinfo.com
Thanks for sharing your blog. In this Blog you have given an Informative Information which are very important for users.
ReplyDeletecheap vps hosting services
best web hosting
best dedicated server hosting
cpanel hosting companies
best cloud servers
best vps hosting companies
To get instant support for QuickBooks problems, dial QuickBooks Customer Support Phone Number +1 866-669-5068. Our team makes sure to provide you with the best-in-class technical service for QuickBooks at a reasonable rate.
ReplyDeleteThanks for sharing this information. Searching for the best luxury villa in Goa for rent? If yes then visit our company Maison 9. Appreciate remarkable vacations in north Goa at luxury private pool villa. Book now or call now 9810132318.
ReplyDeleteIf your laptop has a hardware issue, or if it is faulty, you need to visit a Dell service center in Borivali. They can fix any kind of problem with your laptop and provide software installation. They can also do data recovery and clean your laptop, if necessary. Regardless of the problem, you can rest assured that the technicians at the Borivali service center will do a top-notch job.
ReplyDeleteValue assignment help act as a tuition teacher and guides students looking for online academic assistance for assignments, homework, and essay writing services. contact valueassignmenthelp.com they provide plagiarism free content. Value assignment help is the best solution for you. They are best known for delivering assignment help services to students without having to break the bank. WhatsApp no.: +91-9872003804, +61-413228507.
ReplyDeleteNice Post Your content is very inspiring and appreciating I really like it
ReplyDeleteLaunch Date
The new Maruti Suzuki Vitara Brezza 2022 is expected to be launched sometime in June 2022.
Commission
Under the hood, the new Brezza 2022 is expected to be powered by the same 1.5-liter K- Series petrol engine as the current-generation model, which produces 103 horsepower and 138 Nm of torque. The five-speed manual transmission and the four-speed automatic torque converter will also likely continue.
Brezza 2022
In addition, All Places Map is helpful for students as well to find New York Zip Code. It is one of the best study abroad apps for students who are planning to study abroad. You can find all necessary information about the country you are going to study in. You can find information about universities, housing, visa process, food, culture, transportation and everything.
ReplyDelete