LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   USB Optical Mouse Data Acquisition (https://www.linuxquestions.org/questions/linux-software-2/usb-optical-mouse-data-acquisition-536493/)

fuzzyash 03-11-2007 06:17 AM

USB Optical Mouse Data Acquisition
 
Hi All,

I am looking for a way to view the raw data being sent from my USB optical mouse.

A little background on why:
I want to use the optical reader as a linear position sensor for a CNC project I am working on. I figure it would make a good position feedback sensor.

I've been googling for a while but haven't found exactly what I'm looking for.

Even better would be if someone out there could point me to a site that explains how the data is encoded. I know how the device itself works but nothing about the way the data is sent to the PC.

Thanks

dannystaple 03-11-2007 06:38 AM

Quote:

Originally Posted by fuzzyash
Hi All,

I am looking for a way to view the raw data being sent from my USB optical mouse.

A little background on why:
I want to use the optical reader as a linear position sensor for a CNC project I am working on. I figure it would make a good position feedback sensor.

I've been googling for a while but haven't found exactly what I'm looking for.

Even better would be if someone out there could point me to a site that explains how the data is encoded. I know how the device itself works but nothing about the way the data is sent to the PC.

Thanks

An optical mouse is likely to be a standard USB HID device. Maybe this link- www.usb.org/developers/devclass_docs/HID1_11.pdf - will help you.
In fact, you may be able to get some implementation information by getting the kernel sources, and starting at the file "usbmouse.c" - which is under drivers/usb/input.

Cheers,
Danny

fuzzyash 03-13-2007 06:26 AM

Hmmm...

Thanks dannystaple. I guess thats exactly what I asked for but far more in depth than what I'm looking for!

Without having to learn all the internal workings of the USB protocol & then all the mouse workings is there an easy way of acquiring just the X/Y motion information from an optical mouse, say by simply scanning for every 5th byte (just grasping at thin air here!) or something?? I would like not to have the mouse plugged into a USB port but wired into a simple data acquisition PCB of my own design.

Does anyone know of any How-Does-It-Work style sites out there that this info might reside on??

Spose I'm just hoping it's going to be simple enough to be viable to use!


All times are GMT -5. The time now is 08:19 PM.