reading input from multiple USB mice?

Does anyone have an example sketch of how to get input from multiple USB mice?
You should not have to modify the mice in any way, and ideally they would connect to the Arduino through a USB hub plugged into a single USB 2 or USB 3 port.
Any help appreciated...

One principle of USB is: there are different roles. Host and device/peripheral (master - slave). Normally the computer is host and the mouse is a peripheral, an Arduino board is a peripheral too. A host can communicate with a peripheral and vice versa. But a peripheral can not communicate directly with an other peripheral. And two hosts cannot communicate over their USB ports directly.
(Details see: USB - Wikipedia)

So if you want a mouse to communicate with an Arduino, the Arduino needs to be host. Most Arduino boards can not be host (but there are some Boards that can).
You could use an Arduino Host Shield to get host functionality. But you would need one Host Shield for every mouse.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.