Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rbabu1
Beginner
1,046 Views

Using USB interrupts (from Joystick) on Intel Edison while performing other tasks on the main loop

I am working on an application that runs a few tasks in the main loop, but has to be sensitive to inputs from an USB joystick

I have come across Intel Edison codes (https://software.intel.com/sites/default/files/managed/7e/79/maker-garage-joystick-guide.pdf https://software.intel.com/sites/default/files/managed/7e/79/maker-garage-joystick-guide.pdf ) where the Joystick is read using polling.

I have come across Intel Edison codes wherein the GPIO is read using interrupts.

Is there a way to respond/ read the inputs from an USB joystick (or any USB device) using interrupt or a non-thread-blocking way. Any pointers/ resources would be welcome!

0 Kudos
4 Replies
KMill10
Valued Contributor II
56 Views

I haven't tried this on Edison, but normally when you plug a USB joystick into a linux machine, a node is created at /dev/js1 (or similar) and then you can use normal "read" code to read events from the joystick.

You could put the read loop in a separate thread and post callbacks to your main thread.

idata
Community Manager
56 Views

Hi Ramnath,

Thanks for your interest in the Intel® Edison™ Platform.

Unfortunately, there isn't a guide explaining how to use interrupts with a Joystick. Nevertheless, I did some research on my own and I found this video https://software.intel.com/en-us/videos/episode-8-using-a-joystick-with-intel-edison-technology Episode 8 | Using a Joystick with Intel® Edison Technology | Intel® Software that shows how to set up a joystick with the Intel® Edison.

Maybe you can use this video and the suggestion provided by SpiderKenny as reference in order to achieve your project goals.

Hope you find this information useful, have a nice day!

Best Regards,

 

-Jose P.
rbabu1
Beginner
56 Views

Thank you Keeny for the reply. Will check the read and post to callback route using Python

idata
Community Manager
56 Views

Hi Ramnath,

 

 

Were you able to try SpiderKenny suggestion? Please let us know in order to assist you.

 

 

Have a great day!

 

 

Best Regards,

 

-Jose P.
Reply