This is an Arduino library for ADNS3080 mouse sensor. It provides a simple interface to retrieve motion and frame data from the sensor. See the following schematic to connect a comercial module to an Arduino Uno. It is the same for other boards except the SPI spins change.
The camera must be focused for the sensor to work properly. See the following repo to focus the lens: ADNS3080_frame_capture. It contains an arduino sketch and a python script that work in conjunction with this library.