This example listens for a byte coming from the serial port. When received, the board sends a keystroke back to the computer. The sent keystroke is one higher than what is received, so if you send an "a" from the serial monitor, you'll receive a "b" from the board connected to the computer. A "1" will return a "2" and so on.
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.
Connect your board to your computer with a micro-USB cable.
Once programmed, open your serial monitor and send a byte. The board will reply with a keystroke that is one number higher.
image developed using Fritzing. For more circuit examples, see the Fritzing project page
Last revision 2015/08/11 by SM