Can any Raspberry Pi/Arduino experts tell me what are the best options of sending data from the RPi to a Leonardo given the following:

  1. Running Raspbian on the RPi.
  2. Running a Python script on the RPi which detects mouse data, movement.
  3. Only need to send mouse data to Leonardo.

Plug the Leonardo in to the USB port of the Pi. Open the serial port /dev/ttyACM0 and send the data. On the Arduino receive the data through the Serial object.

Alternatively, connect the Pi's TX pin to the Leonardo's RX pin, and connect the Leonardo's TX pin, through a 5V -> 3.3V level shifting circuit (there's lots of options - google them) to the Pi's RX pin, then use /dev/AMA0 instead of /dev/ACM0.

  • \$\begingroup\$ thanks. if both USB ports are being used is there another option? \$\endgroup\$
    – Bachalo
    Jul 10 '14 at 14:40
  • 1
    \$\begingroup\$ Add a powered USB hub? \$\endgroup\$
    – Majenko
    Jul 10 '14 at 14:43
  • \$\begingroup\$ @eco_bach: did you read the "alternatively..."? \$\endgroup\$ Jul 10 '14 at 17:51
  • \$\begingroup\$ @WoutervanOoijen I added that after the comment. \$\endgroup\$
    – Majenko
    Jul 10 '14 at 18:04
  • \$\begingroup\$ thanks! will try. By 'level shifting circuit' I assume you mean a logic converter? sparkfun.com/products/12009 \$\endgroup\$
    – Bachalo
    Jul 10 '14 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.