This repo contains a python script and an arduino sketch to render the output of an ADNS3080 mouse sensor as a grayscale image. This is ideal for focusing the lens on the sensor as its obvious when an image is blurry. Doing so greatly improves the SQUAL value and the subsequent motion detection.

The script was written in python 3 and requires the pyserial library. The arduino sketch makes use of the ADNS3080 library. Credit goes to Lauszus for the inspiration. The script is largely based on his work.

Both files work in conjunction and must have the same baud rate and begin character. This last value controls when the python script starts and stops receiving information from the arduino.

A properly focused camera should generate these kinds of images: image image image

Github Repo:

ADNS3080_frame_capture