Arduino Leonardo / YUN as HID keyboard for PC

Firstly I am familiar with Atmega and various embedded processors. But I don't know everything. :~

sadly I am new to aurdino itself.

I have a very limited time and a specific task i have realized i may be able to much faster with Arduino

I have Arduino Leonardo + YUN + UNO. (I have AVRISP mkII if needed)

I want to program/configure arduino to attach a PC as a HID device and send certain keys when a button is connected to GPIO.

I need to send a set of key press via USB HID protocol.

simply i need to connect the arduino to PC and get recognized as HID keyboard

I do need to be able to send so called modifier key codes.

example

a mechanical key pressed arduino needs to send (just a single pre defined GPIO no multi key press on the arduino side)

Ctrl +Alt
wait 200ms
Ctrl+Alt+F1
wait 200ms
Ctrl+G

etc etc

I have found few arduino HID projects both with Uno and Leonardo (Yun is a Leonardo in a way too)

I can not get clear indication with if all these keys and (kind of macros) can be send

this seems to be the most basic one. http://forum.arduino.cc/index.php/topic,111.0.html

I am stuck with time and dont have enough development time for this. I do know that it is a simple task once I have get around with the IDE and other details.

If any one can offer any advice it is appreciated.

cheers

I don't have a Yun (or a Windows PC) but what you want should work with a Leoonardo

The reference page shows that there are separate keyboard.press() and keyboard.release() functions. The example shows ctrl-key combinations.

...R

Firstly I am familiar with Atmega and various embedded processors. But I don't know everything. smiley-confuse

sadly I am new to aurdino itself.

I think it's generally the other way out, generally people know Arduino and then from Arduino they come to know such a thing like an ATmega exists :wink:

Nevermind.

you need a USB micro with HID stack supported on it which in Arduino realm is the Leo.

NI$HANT:

Firstly I am familiar with Atmega and various embedded processors. But I don't know everything. smiley-confuse

sadly I am new to aurdino itself.

I think it's generally the other way out, generally people know Arduino and then from Arduino they come to know such a thing like an ATmega exists :wink:

Nevermind.

you need a USB micro with HID stack supported on it which in Arduino realm is the Leo.

ha ha but it is true.. I work with atmel and atmega far before the arduino come out. However I am not the guy who generally writes the code.. and strangely the only reason i know the arduino is because it has AVR :))))

I have used AVRs before the Y2K problem. LOL any one remember those days....

any way thanks I will have a look at the links above first... I hope i will not get lost in the IDE..

cheers

any way thanks I will have a look at the links above first... I hope i will not get lost in the IDE..

Naah! The IDE has it's own benefits and limitations but is generally good for beginners, also you may goto VISUAL STUDIO plugin for arduino ide so you can have a very good dev. environment to develop some wiring code.

I would like to thank everyone who recommended or commented here.

here is my experience so far.

yes I can see some shortcomings and limitations of the arduino IDE straight away.

HOWEVER....

I have downloaded the Arduino IDE for the first time in my life.
I have powered up my first Arduino Board (Leonardo) in my life.

I was able to;
-do my project, a keyboard emulator with 5 Hardware keys translating various keyboard macros on the host, CODE
-connect the HW keys
-flash the board (Arduino -AVR)
-test
in TOTAL HALF AN HOUR or so...... all done completed exited from the IDE, connected the Arduino to the target machine!!!!!!!

this is amazing thanks everyone :slight_smile:

Contrary;

even with my experience with AVRs, in that period of 1/2 hour, I would be trying to figure out which libraries to include in my project, or wondering which fuses to set what on the AVR etc, if i was trying to code the AVR directly, no matter which IDE.....

there is NO WAY I would be able to do this in such a time...

I am impressed... :slight_smile:

Yes offcourse this is a super fast prototyping platform, so keep coming back :grin:

Everything has its own limitations and strengths so I'll say that Avr programming using it's conventional tools give you full control vs. Fast prototype development with Arduino.

NI$HANT:
Yes offcourse this is a super fast prototyping platform, so keep coming back :grin:

Everything has its own limitations and strengths so I'll say that Avr programming using it's conventional tools give you full control vs. Fast prototype development with Arduino.

you do have to understand my hesitation, for a while, when I realized that i don't have access to the libraries included or the core settings of the AVR (fuses and all nitty gritty)

but it worked so who cares.....

deleted

here are the available modifier key presses.

http://arduino.cc/en/Reference/KeyboardModifiers

nippit:
yes I can see some shortcomings and limitations of the arduino IDE straight away.

If you select the external editor option in preferences you can do all your editing in your favourite code editor (I use Gedit) and then you just use the IDE for compiling and uploading.

As you say the fact that the IDE "just works" is wonderful.

...R