USB keyboard to Arduino

I struggle to use a X-keys keyboard to my Arduino Yun. I would use a X-Key to send in a keystroke to my Arduino-code.

I follow the steps in this... USB Keyboard issue - #7 by sonnyyu

I can see my X-keys is alive with: "cat /dev/input/event1 | hexdump"

In this thread USB Keyboard issue - #9 by sonnyyu (Post #10) and the bridge-code I don´t understand what and where to change to recive anything in "Bridge.get("key", data, 2); //get latest parsed data" (Post #9)

I also found this thread and try... USB Keyboard issue - #6 by ShapeShifter but when I come to this "nano /mnt/sda1/keyinput.py" I got error "-ash: nano: not found". So I can´t add this part to a Python-file. When I search for "nano" I got a lots of post about Arduino Nano, not the Linux-command "Nano" and how to install it on my Yun.

I am a beginner on Linux and try to find most things with Google, but when you sit for hours without finding the right one, I unfortunately have to ask a question in the forum.

I use Arduino Yun rev 2

Now i run on this one Using USB Keyboard - #29 by ShapeShifter and try to make a process, because I managed to copy the evdev.py to my Linux on the right spot.

I don´t get any error for this:

p.begin("#!/usr/bin/python -u /mnt/sda1/evdev.py '/dev/input/event1'");
p.runAsynchronously();

and I don´t get any out from

while(p.available())
(char)p.read();

in my loop(). If I remove while... I got a lots of sign just rolling out the serial monitor screen.

If I try #!/usr/bin/python -u /mnt/sda1/evdev.py '/dev/input/event1' directly in Linux, I don´t get any error messages. If I remove #! it says "can´t open file..."

Still hunting for a solution.

To install Nano on my Yun it work with this guide. https://www.instructables.com/Using-nano-instead-of-vi-on-your-Arduino-Yun/

Unfortunally still confused where to change the "Bridge code:" in USB Keyboard issue - #9 by sonnyyu ... :thinking:

I follow these steps in Using USB Keyboard - #20 by sonnyyu and get result from "python evdev.py '/dev/input/event1'" (instead of "evdev.py '/dev/input/event1" as it says in the post). So my X-keys comunicate with my Arduino Yun (even a small numpad works fine).

I try this code Using USB Keyboard - #21 by sonnyyu but nothings prints out on my serial monitor. Even if I try to diffrent "p.begin("/usr/bin/python -u /mnt/sda1/evdev.py '/dev/input/event1'");" in Using USB Keyboard - #30 by petros00

Still lost when I came to Using USB Keyboard - #21 by sonnyyu "Combine both code" and when people write it´s not recomended... Do I need to do anything else with the Python-code to have it up and running in my Arduino sketch?... should i change my evdev.py with ShapeShifters code in Using USB Keyboard - #32 by ShapeShifter

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.