I've written a pyUSB script in IDLE2 that records mouse movement and clicks etc and outputs it to the Rpi GPIO via PWM.
Im having a problem where I need the mouse data to be zero when its not moving as at the moment it just holds its previous value until it detects movement again.
I could constantly scan the array and check for values changing, but I'm having trouble figuring out how to do this. I have kind of implemented this but I'm having trouble getting it to constantly scan the data array as it only updates when movement is detected.
Or could I just request a HID Report Descriptor and compare the input strings?
Anyone have any ideas?