Since the code and the schematics are self explanatory, and the datasheet for the MCU and the image sensor are rather informative, I'm not going to get into much theory here (as always, questions are answered). Here's the flowchart of the system, which explains what's going on. Ignore the USART part (old version), registers are set up from the MCU :) And an animated GIF image showing brightness tracking done with this camera in Processing.
The first thing to do before you start is to create a suitable connector for the camera (after opening the cartridge structured box with a tri-wing screwdriver and disconnecting / removing the camera from the main structure). I attached a picture of the pinout, so many people used this image, so I don't know who to give the credit (here's one http://www.seattlerobotics.org/encoder/200205/gbcam.html
). I used an IDC-10 connector to connect it to my old PIC board (from another project).
In the next step we'll be looking at the schematics and how the system actually functions.