We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Basically I want to have a button connected to arduino and when pressed I want it to be as if "A" was pressed on the keyboard. The code I got so far:
void setup() {
pinMode(4, INPUT);
Keyboard.begin();
}
void loop() {
if (digitalRead(4) == HIGH) {
Keyboard.write(65);
}
else {
Keyboard.write(0);
}
delay(100);
}
Now when I verify it, there's no error. When I upload it however, I get the message that Keyboard is only available on Arduino Leonardo (I bought UNO). So I'm wondering if the code like this would work on a Leonardo or if the code is totally wrong?
Answers
You can write code to emulate keyboard action using UNO but that would be pain in the ass so I would suggest you use to Arduino Due, Leonardo, or some advance Arduino board
Here is the sample code for emulating Keyboard and mouse action using Arduino
As per you concern these libraries only work with advance board. :( so sadly these functions do not work with UNO or UNO pro :(