I am new to the Leonardo, having only used a duemilanove before, and I am interested in using it's USB capabilities for a project.

Basically I need it to be an input and output device, communicating to an app on the PC (probably written in C#). I need to be able to handle button presses on the arduino and get data back from the PC to display on a display connected to the arduino.

I already have the basics done hardware wise (getting the keypad and displays working as I want them to), but now the tricky part is the USB communication. The only things I can find seem aimed at emulating a keyboard and mouse - I need 2 way communication data wise.

Are there any examples of something like this? I am sort of looking for the arduino equivalent of this: http://www.waitingforfriday.com/index.php/Building_a_PIC18F_USB_device

An alternative would be to just use serial, but I don't want to be fiddling with COM ports on the PC side - it just needs to be plugged in and work.

Would be grateful for any input on this subject, if it is even possible!

  • Congratulations, you've successfully found a project that goes beyond what the Arduino IDE provides for you out of the box. Your options are to 1) write a custom Arduino core that has additional/only the USB connections you need, or 2) do the same but with LUFA or ASF. – Ignacio Vazquez-Abrams Sep 3 '15 at 21:35
  • BytesGuy, from ArduinoBoardLeonardo at arduino.cc, “on the Leonardo, the Serial class refers to USB (CDC) communication”. That is, its Serial link is a USB link and does not involve any RS232-type serialization at either end of the link, merely the usual amount of link-level serialization that Universal Serial Bus entails. So I see no reason not to use it, aside from its clunky API. – James Waldby - jwpat7 Sep 3 '15 at 21:39
  • @IgnacioVazquez-Abrams Yeah I thought it was a bit ambitious :) – BytesGuy Sep 3 '15 at 22:02
  • @jwpat7 Interesting, I will have to dig a bit deeper with that. I have only used Serial with the old FTDI style duemilanove. – BytesGuy Sep 3 '15 at 22:02
  • On any version of Windows below 10 you will need to install drivers for the serial to work. It won't just "plug in an work". For that I think you need to use the USB HID protocol, which is the bi-directional variant of the keyboard and mouse interface. – Majenko Sep 4 '15 at 9:57

Your Answer

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

Browse other questions tagged or ask your own question.