Hi
The Leonardo has a keypad. The keys pressed have to be transfered to the Yun who has to process these keys.
I would like to connect an Yun and a Leonardo via USB.
How can I do that?
Can I connect the Leonardo to the Yun like plug in a USB cable to the Host port of the Yun and then to the Leonardo?
I connect both to a USB Hub. How?
How can send serial Data from the Leonardo to the Yun.
I already found a part of a solution for my problem.
I connect the Leonardo with a Micro USB cable to the host port of the Yun.
Then I did something which I found here: http://blog.baeyens.it/#post11
I did:
opkg update
opkg install kmod-usb-acm
opkg install minicom
minicom -o ttyACM0
setup the serial port (baudrate & device /dev/ttyACM0)
Bingo I can see the output of the Leonardo (done with Serial.println)
Now I need a program just to read /dev/ttyACM0 and to setup the baudrate.
mart256:
Yep, that sounds like the choice, unless those pins are already used.
+1
Plan C:
Yun shield + Arduino Mega
It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports). It will make life easy.
Thanks for Plan B to Plan C, but the Yun is already at its limit and the keypad uses many IOs, so I needed a second device the Leo. The hardware for this project is set.
The charming thing is I just need one USB Cable to the Leo.
First I was thinking of using the Leo as an USB keyboard. But it seems to be more complicated to implement HID USB on the Yun (at least it is not there out of the box).
So in this case my Plan B was USB serial. I think I will run some Python code to read ttyACM0 and process the input with that Python code.
The Yun shield (+Mega) is a nice Device maybe I will use that in another project. Thanks for your help guys.