I have Arduino UNO and I would like to create 4 buttons where:
If I press the button 1 the Pc press "a" on the keyboard, if I press button 2 "b", button 3 "c" and button 4 "d".
To be more specific: I want write on MicrosoftWord Document NOT using "a" on the keyboard but pressing the button 1 created with Arduino. I need only 4 buttons, not more.
sorry, the Uno will not do that. A micro or a couple of other boards will emulate a keyboard, but not the standard Uno or Mega. This is from the keyboard reference:
These core libraries allow a 32u4 based boards or Due and Zero board to appear as a native Mouse and/or Keyboard to a connected computer.
USB keyboards cost a few dollars, $1 or less if second hand, free if keys missing.
Open it up, remove the PCB assembly and work out which connections correspond to each of the keys you want to encode.
Compact, simple, cheap, perfect performance.
Actually, a UNO can, where a Duemilanove/ Micro cannot.
From the Micro product page:
The Micro is the smallest board of the family, easy to integrate it in everyday objects to make them interactive. The Micro is based on the ATmega32U4 microcontroller featuring a built-in USB which makes the Micro recognisable as a mouse or keyboard.
And if you look at my video #30 you will see how a Sparkfun Pro Micro / Leonardo sends back keystrokes to your PC (acting as a keyboard). URL in the footer of this post.
TeoFunk:
Can I or Can't emulate a keyboard with Arduino Uno? If yes, what I need to buy more?
No you can't.
Only an Arduino board that presents a virtual USB port or which has a separate USB port will allow this (such as the Elektor UNO v4).
An Arduino Micro or Leonardo will work as will a Sparkfun Pro Micro - basically one that has a 32U4 on board programmed to deal with USB instead of, say, a CH340G chip as found on UNO clones.
ROFL! I don't know what part of the world you're from but that is most definitely a true "typical British understatement"!
I wonder if Paul__B truly expects a noob (of the sort that asks this sort of question) to even understand those links. Let alone implement them. All for the sake of a $2 pro Micro that does it " out of the box ".
I was actually anticipating some further discussion about what a "real" UNO is.
It is somewhat annoying that (irrespective of the copyright considerations) bogus devices using a CH340 are being fraudulently advertised as "UNOs" where clearly they are not at all related to the UNO.
Without a 16U2 (or the earlier version) they are nothing more nor less than a Duemilanove clone or variant.