Author Topic: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!  (Read 19324 times)

0 Members and 1 Guest are viewing this topic.

Offline ziegler

  • Regular Contributor
  • *
  • Posts: 68
  • Country: dk
Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« on: October 09, 2015, 05:32:03 pm »
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 post
https://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)
« Last Edit: October 09, 2015, 05:39:57 pm by ziegler »
 

Offline ziegler

  • Regular Contributor
  • *
  • Posts: 68
  • Country: dk
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #1 on: October 09, 2015, 05:48:34 pm »
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)
 

Offline tyguy2

  • Supporter
  • ****
  • Posts: 283
  • Country: us
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #2 on: October 09, 2015, 07:01:48 pm »
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. 
« Last Edit: October 09, 2015, 07:06:09 pm by tyguy2 »
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2559
  • Country: gb
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #3 on: October 09, 2015, 07:09:51 pm »
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").  :-+
 

Offline Neverther

  • Regular Contributor
  • *
  • Posts: 129
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #4 on: October 09, 2015, 09:31:27 pm »
vusb?

I used that and IR receiver to make HID keyboard out of old DVD remote.
 

Offline ziegler

  • Regular Contributor
  • *
  • Posts: 68
  • Country: dk
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #5 on: October 09, 2015, 09:59:11 pm »
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. 
This 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 ?)

vusb?

I used that and IR receiver to make HID keyboard out of old DVD remote.
this 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)
 

Offline ziegler

  • Regular Contributor
  • *
  • Posts: 68
  • Country: dk
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #6 on: October 09, 2015, 10:30:50 pm »
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.
 

Offline The Magic Rabbit

  • Regular Contributor
  • *
  • Posts: 108
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #7 on: October 10, 2015, 01:20:48 pm »
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

 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6004
  • Country: us
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #8 on: October 10, 2015, 01:35:03 pm »
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 one https://www.sparkfun.com/tutorials/337
Drain the swamp.
 

Offline dentaku

  • Frequent Contributor
  • **
  • Posts: 849
  • Country: ca
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #9 on: October 11, 2015, 02:03:26 am »
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
 

Offline tyguy2

  • Supporter
  • ****
  • Posts: 283
  • Country: us
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #10 on: October 11, 2015, 04:08:26 pm »
Hmmm, perhaps I'm remembering a different software then. I'm sorry about that.   :-\ I'll look around

Edit:
You could always buy:
http://pages.ebay.com/link/?nav=item.view&alt=web&id=201037850851&globalID=EBAY-US
I think I confused the Processing software vs. Arduino, who knows. :-/O
« Last Edit: October 11, 2015, 04:10:39 pm by tyguy2 »
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline ziegler

  • Regular Contributor
  • *
  • Posts: 68
  • Country: dk
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #11 on: October 17, 2015, 05:03:45 pm »
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.
 

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 985
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #12 on: October 17, 2015, 05:29:22 pm »
I would stick with the MIDI idea. That is totally doable.
Not sure what makes you think it is not fast enough....?
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline MLXXXp

  • Regular Contributor
  • *
  • Posts: 247
  • Country: ca
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #13 on: October 17, 2015, 09:48:20 pm »
Now I just need a way to fit the Leonardo to the footswitch
If 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/12640
https://www.arduino.cc/en/Main/ArduinoBoardMicro
http://www.ebay.com/sch/i.html?_nkw=pro micro 32u4&mfe=search

Both can easily emulate a USB keyboard, just like the Leonardo.


« Last Edit: October 17, 2015, 09:59:40 pm by MLXXXp »
 

Offline ziegler

  • Regular Contributor
  • *
  • Posts: 68
  • Country: dk
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #14 on: October 18, 2015, 06:55:01 am »
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 ?)
 

Offline MLXXXp

  • Regular Contributor
  • *
  • Posts: 247
  • Country: ca
Re: Press Keyboard keys with a Arduino nano v3. HOW ?!?!?!
« Reply #15 on: October 18, 2015, 04:09:33 pm »
I know that the Leonardo board can use the Arduino keyboard library, but will the Micro be able to use it ?
The 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.

zapta pointed out a tutorial on using the Pro Micro as a keyboard/mouse in an earlier post in this thread. Did you not see it?
« Last Edit: October 18, 2015, 04:13:07 pm by MLXXXp »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf