NB: When you use the Keyboard.print() command, the Leonardo, Micro or Due board takes over your computer's keyboard! To insure you don't lose control of your computer while running a sketch with this function, make sure to set up a reliable control system before you call Keyboard.print(). This sketch is designed to only send a Keyboard command after the board has received a byte over the serial port.
Step 1: What You Need?
1 x Arduino Leonardo, Mirco, or Due Board
1 x Micro USB Cable
Don't have components? Don't worry. Just click the component's name.
Step 3: Upload The Code.
1. Select the Arduino board type: Select Tools >> Board >> Select your correct Arduino board used.
2. Find the port number by accessing device manager on Windows. See the section Port (COM&LPT) and look for an open port named "Arduino Leonardo (COMxx)". If you are using a different board, you will find a name accordingly. What matters is the xx in COMxx part. In my case, it's COM3. So my port number is 3.
Select the right port: Tools >> Port >> Select the port number.
3. You can find this code in the example of Arduino IDE.
Select File >> Examples >> 09.USB >> Keyboard >> KeyboardSerial
Click press the "upload" button (see the button with right arrow mark).
Once programmed, open your serial monitor and send a byte. The board will reply with a keystroke that is one number higher.
Once programmed, open your serial monitor and send a byte. The board will reply with a keystroke that is one number higher.
0 comments:
Post a Comment