Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9877 Discussions

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

rbabu1
Beginner
1,200 Views

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
210 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
210 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
210 Views

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

idata
Community Manager
210 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