Go Down

Topic: How to read a USB joystick plugged into the native USB port? (Read 3145 times) previous topic - next topic


Hi, I'm new to Arduino programming, but I'm having trouble reading from the USB native port on my Arduino DUE board.

I have a Cyborg PC Flight Stick v1 usb joystick connected to the native USB port on my DUE and I cannot detect any input from the joystick.

The program is as follows:
Code: [Select]

void setup() {
  // initialize serial:

void loop() {
  // if there's any serial available, read it:
  while (SerialUSB.available() > 0) {

I can't seem to find any info on the SerialUSB class.
What am I doing wrong?  Any help would be appreciated! 


Jun 28, 2013, 12:43 am Last Edit: Jun 28, 2013, 12:46 am by AlfredJingle Reason: 1
You need to have a library for reading data from a USB joystick with your Arduino. For instance you could try



Hey Alfred,
Thank-you for your suggestion.  I will definitely give that a try. 


I am trying the same thing. I made it work about 10 minutes ago by "porting" parts of the USB Host Shield 2 stack. It's basically renaming "USB" class usages into USBHost as well as renaming quite a few uint8_t into uint32_t in the virtual methods.

I will do a clean port of it again and wrap it up as a library. If time allows I'll also write a short readme on how to port host shield stack drivers to the Due.



can you publish your code, even if its not yet finished?


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131