Hi there,
The TCCR2 part of the code controls timer 2 of the Atmega8 chip and is used to generate PWM signals that drive the motors (see the timer intterupt code at the bottom of the sketch). You can find a full explanation of how to control the timer in the
Atmega8 deatasheet. This code was needed because it was not possible to use the Arduino Servo library (to control the neck motors) at the same time as using AnalogWrite to generate a PWM signal for the wheel motors on the Atmega8. This shouldn't be a problem for the MkII mini driver which uses the Atmega328, so you should be able to write some simpler motor control code.
The mini driver should just wait for motor commands from the Pi. If it doesn't get any movement commands for 2 seconds or more then it will turn off the wheel motors.
If the mini driver power switch is off then the Pi will try to supply power to the mini driver via the USB port. Usually this will cause too much current to be drawn however, and the USB port will temporarily shut down. It will then start up again and repeat the cycle.
Hope that helps.
Regards
Alan