Press Keyboard keys with a Arduino nano v3. HOW ?!?!?! - Page 1
Forum section: electronics / beginners

author: ziegler
author_rank: Regular Contributor
timestamp: October 09, 2015, 05:32:03 pm
content: Hello guys.this was a project I stopped working on 120 days ago, when i tried to turn a old piano foot controller, into a cool new midi controller.but when I started to look for the code that would be needed, I found out that this model was too slow, to work as a good midi control.(here is the old posthttps://www.eevblog.com/forum/beginners/convert-a-old-8-pin-midi-foot-controller-to/15/)Then I wanted to turn it into a keyboard-key-presser, to make stuff easier at my computer.But here I hit my head against the wall again, when I found out that there isn't any arduino library, for keyboard stuff, that work on a nano.So I wanted to see if you guys had any ideas, to how I can make this work.(Seem like I just should have bought a teensy board in the first place)

author: ziegler
author_rank: Regular Contributor
timestamp: October 09, 2015, 05:48:34 pm
content: The key-commands I want to use is (arrow_up , arrow_down , arrow_left , arrow_right) when i press one of the switches.(each switch, has only one key-command)

author: tyguy2
author_rank: Unknown
timestamp: October 09, 2015, 07:01:48 pm
content: You could write a program in Processing (https://processing.org) to read the Serial Port coming from an Arduino. Say for instance, you press up on your arduino, it sends "up" via the serial port, a processing program register it, pressing a key.

author: Macbeth
author_rank: Super Contributor
timestamp: October 09, 2015, 07:09:51 pm
content: Look up USB HID, and then forget it and implement it with an app on the PC side to read from the nano serial port and use an operating system command method (like in Windows with VBA or .NET, "SendKeys" and "AppActivate").

author: Neverther
author_rank: Regular Contributor
timestamp: October 09, 2015, 09:31:27 pm
content: vusb?I used that and IR receiver to make HID keyboard out of old DVD remote.

author: ziegler
author_rank: Regular Contributor
timestamp: October 09, 2015, 09:59:11 pm
content: Quote from: tyguy2 on October 09, 2015, 07:01:48 pmThis looks like it can do the trick. Now I can move on with the project.The only thing that is annoying, is that it need a running/open software on the pc, to read the serial data.(Not sure about this. I like it to work the same way as, some of my other usb device, which uses some drivers that is installed on the OS. Can it be done ? and if yes, is it hard ?)Quote from: Neverther on October 09, 2015, 09:31:27 pmthis look like a really good tool to have/know. Can I use it with the usb-port that is build-in, in the Nano ?(I have a shit load of old dvd remotes, so that could really be fun to reuse them for something)

author: ziegler
author_rank: Regular Contributor
timestamp: October 09, 2015, 10:30:50 pm
content: I have changed my mind about Processing.I'm trying to make it press a key on my keyboard (digital), but I can only find methods/functions about reading a pressed key.So tyguy2, if you know how to do this, please tell me how.

author: The Magic Rabbit
author_rank: Regular Contributor
timestamp: October 10, 2015, 01:20:48 pm
content: I just grabbed a USB keyboard from a broken system, ripped the tiny control board out, and wired up switches to whichever pair of contacts triggered the keys I want. One generic universal USB foot switch, works on anything that supports USB keyboards.With USB Keyboard MIDI (software) you can then use any USB keyboard as a MIDI controller. I think the last one I used was Xlutop Chainer.Sent from my XT1039 using Tapatalk

author: zapta
author_rank: Super Contributor
timestamp: October 10, 2015, 01:35:03 pm
content: Arduino nano is not a good choice to emulate USB HID keyboards because it's USB communication goes though an FTDI IC that support serial communication only. Try searching for: arduino hid keyboard. There are plenty of good hits. For example this onehttps://www.sparkfun.com/tutorials/337

author: dentaku
author_rank: Frequent Contributor
timestamp: October 11, 2015, 02:03:26 am
content: The Teensy is an Arduino compatible microcontroller board that lets you use it as a Keyboard, Mouse, Joystick, Serial or MIDI controller using the devices own USB port.You should look into it.https://www.pjrc.com/teensy/teensyduino.html

author: tyguy2
author_rank: Unknown
timestamp: October 11, 2015, 04:08:26 pm
content: Hmmm, perhaps I'm remembering a different software then. I'm sorry about that.I'll look aroundEdit:You could always buy:http://pages.ebay.com/link/?nav=item.view&alt=web&id=201037850851&globalID=EBAY-USI think I confused the Processing software vs. Arduino, who knows.

author: ziegler
author_rank: Regular Contributor
timestamp: October 17, 2015, 05:03:45 pm
content: Okay just ordered a cheap Leonardo R3 Pro board and a Teensy 2.0 usb.I would really like to use the Teensy, since it fit just right in this footswitch.But i'm thinking that I will use it for a other project.Now I just need a way to fit the Leonardo to the footswitch, maybe make a new wood block to replace the old one. (but that will look a little stupid).The boards will be at my door at the end of this month or in the middle of the next one.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: October 17, 2015, 05:29:22 pm
content: I would stick with the MIDI idea. That is totally doable.Not sure what makes you think it is not fast enough....?

author: MLXXXp
author_rank: Frequent Contributor
timestamp: October 17, 2015, 09:48:20 pm
content: Quote from: ziegler on October 17, 2015, 05:03:45 pmIf the size of a Leonardo is a problem, use a Pro Micro or Arduino/Genuino Micro (or a cheap Chinese clone of one of them).https://www.sparkfun.com/products/12640https://www.arduino.cc/en/Main/ArduinoBoardMicrohttp://www.ebay.com/sch/i.html?_nkw=pro micro 32u4&mfe=searchBoth can easily emulate a USB keyboard, just like the Leonardo.

author: ziegler
author_rank: Regular Contributor
timestamp: October 18, 2015, 06:55:01 am
content: That Arduino/Genuino Micro looks way better than my nano, if only I knew that when I started.I know that the Leonardo board can use the Arduino keyboard library, but will the Micro be able to use it ?(the Micro board is way cheaper than the Teensy)The Teensy 2.0 usb have all the code/library that I need out of the box.I have also been looking into this V-USB thing, but I don't like that I need to make a extra board, for it to work.(or do I really need it ?)

author: MLXXXp
author_rank: Frequent Contributor
timestamp: October 18, 2015, 04:09:33 pm
content: Quote from: ziegler on October 18, 2015, 06:55:01 amThe Leonardo, Micro and Pro Micro all use the Atmega32u4 processor and its internal USB interface. They are very similar other than the physical size and a few I/O pins missing on the Pro Micro. So yes, the Micro and Pro Micro can use the Arduino keyboard/mouse library just as well as the Leonardo.zaptapointed out atutorial on using the Pro Micro as a keyboard/mousein anearlier postin this thread. Did you not see it?