This was my first robot. WILL-I.
The robot is controlled with an Atmel ATMega8 running on internal oscillator at 1MHz. It uses 3 microswitches and a servo rotated Sharp infrared distance sensor to detect the environment. The AVR is programmed in AVR-GCC with WinAVR+AVR Studio.
The code is very simple. The robot waits until a microswitch is pushed. Than goes forward until it detects that an object in front of it is less than approximately 10cm away (the measured ADC value is greater than 200). Than looking left, measuring the distance of any possible object, looking right and measuring the distance again. When finished with the measurements, it turns in the direction where there is no object found. If one of the microswitches at the end of the arms hits something, it generates an interrupt, and the robot reverses for a short time, than turns the opposite direction.
The schematic of the final version of WILL-I is here: LINK
The AVR-GCC code is at the bottom of this webpage: LINK
The motor.h (dcmotor.h) motor controller code is here: LINK
A small vidoe showing WILL-I in action is here: LINK
P.S.: Sorry, but the linked webpages and the comments in the codes are in Hungarian...
This online Hungarian-English dictionary might help: LINK