user65430: I am trying to use keyboard on my Arduino nano, but i get this error:
'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

As per the answer in Keyboard.h not found, I tried change the board to Arduino Leonardo, even though the script gets compiled it doesn't get uploaded (keeps on saying uploading for a long time).
This is the code I use:
#include <Keyboard.h> 
void setup() {
  Keyboard.begin();
}
void loop() {
}


user42015: To convert the comments into an answer:
You cannot (!) use the Keyboard library on the Arduino Uno/Nano/Mini. It needs a native USB interface to configure it as a HID device, but the Uno/Nano/Mini all use the Atmega328p, which doesn't have a native USB interface. These Arduinos use an additional chip on the board which acts as USB-UART-bridge.
You can compile the code for the Leonardo, because it has a native USB interface. But you cannot (!) upload code, which is compiled for the Leonardo, to an Uno/Nano/Mini. Its a completely different chip.
What to do now: Get an Arduino board which has a native USB interface, for example the Leonardo or the Micro.

65430: <p>I am trying to use keyboard on my Arduino nano, but i get this error:</p>
<pre><code>'Keyboard' not found. Does your sketch include the line '#include &lt;Keyboard.h&gt;'?
</code></pre>
<p>As per the answer in <a href="https://arduino.stackexchange.com/questions/57581/keyboard-h-not-found">Keyboard.h not found</a>, I tried change the board to <strong>Arduino Leonardo</strong>, even though the script gets compiled it doesn't get uploaded (keeps on saying uploading for a long time).</p>
<p>This is the code I use:</p>
<pre><code>#include &lt;Keyboard.h&gt; 
void setup() {
  Keyboard.begin();
}
void loop() {
}
</code></pre>
 42015: <p>To convert the comments into an answer:</p>
<p>You cannot (!) use the <code>Keyboard</code> library on the Arduino Uno/Nano/Mini. It needs a native USB interface to configure it as a HID device, but the Uno/Nano/Mini all use the Atmega328p, which doesn't have a native USB interface. These Arduinos use an additional chip on the board which acts as USB-UART-bridge.</p>
<p>You can compile the code for the Leonardo, because it has a native USB interface. But you cannot (!) upload code, which is compiled for the Leonardo, to an Uno/Nano/Mini. Its a completely different chip.</p>
<p><strong>What to do now:</strong> Get an Arduino board which has a native USB interface, for example the Leonardo or the Micro.</p>
