Posted by John Hinkley on 08/07/2020 15:09:25:
…
would it not be possible to utilise the bluetooth capabilities of a wireless mouse to communicate the output to a program running on a computer, tablet or phone in much the same way as Yury has done for the TouchDRO system? See Here.
Regrettably, I don't have the knowhow to implement the idea and write the necessary code to interpret the quadrature output into a meaningful display.
…
What does the panel think?
John
By using a suitable computer it may not be necessary to sink deep into techy detail. You could just use the mouse as a mouse – remove the buttons and wheel, but retain it's built-in wireless connection, whether Bluetooth or USB dongle. Provided the host recognises mice for you, mouse movements can be detected without worrying about quadrature decoding, wifi protocols, & event management etc.
My choice for this would be a Raspberry Pi 4 running Linux (Raspbian). In UNIX almost everything is a file, including the mouse, so all the DRO program need do is read a file. In Linux the mouse (and keyboard etc) appear as devices in the /dev/input directory. Each mouse appears as a separate file named 'mouse0', 'mouse1' etc.
As working out which one is yours can be tricky they all feed into one device ie "/dev/input/mice", which captures all mouse events whether touchpad, USB, wireless or Bluetooth.
The mouse sends a stream of 3 byte binary records (24 bits long) where:
- First byte, as an 8 bit unsigned integer, reports button presses
- Second byte, as an 8 bit signed integer, reports relative movement in the X direction
- Third byte, also an 8 bit signed integer, reports relative movement in Y
Mouse data read this way is 'raw', ie unconstrained by the size of the screen or windows. When mouse position is read by software working in a graphical context, the windowing system unhelpfully converts raw mouse readings into absolute X,Y coordinates fixed between window 0,0 and window width, height. Equally unhelpfully for a DRO developer, it scales pointer and cursor movement to suit the GUI's human interface )
GUI programming looks hard – raw is what's needed for a DRO.
Testing /dev/input/mice on my Ubuntu workstation, a slowly moving mouse reports X,Y in steps of 1 or -1. However, fast movement is reported in bigger increments, eg -16. Ordinary mice as owned by me aren't very accurate, and I can't comment on the accuracy of a laser mouse, especially if it's moved quickly.
A basic python program that just prints x, y as the mouse is moved:

Whether or not an ordinary user is allowed to read /dev/input/mouse seems to vary. If not, run with sudo.
The output is a stream of positive and negative numbers showing how the mouse is moving:

Seems to work.
I'm testing on a Workstation with a wireless mouse and USB receiver dongle. A RaspberryPi 4, which has Bluetooth, should work the same way and/or with a Bluetooth mouse. So much for the input problem.
Output: Raspberries can serve X to a remote client over Wifi or Ethernet, or a plug in HDMI TV, HDMI monitor, or small HDMI screen, or the GPIO can be used to drive a I2c LCD, LED or TFT device as commonly done in Arduino projects.
So, I'm suggesting a mouse DRO could be a simple file read file, data format, and display application not needing any complicated programming or deep understanding of computer and electronic innards. Lots of unknowns about accuracy and response times but it looks achievable to me in principle.
Dave
Edit Typos galore
Edited By SillyOldDuffer on 09/07/2020 15:12:27