Having started out with the Raspberry Pi driving LEDs then an LCD display I decided to have a go at building a robot.
So this is my first attempt:
Looking at Front Left

Looking at Rear Right

This is using a chassis from a Heng Long Tiger Tank that was going spare after an upgrade.
It has a Raspberry Pi driving two pairs of L298 motor controllers which have been paralleled up to achieve the necessary current drive to each motor. These are being driven by one port on a MCP23017 GPIO expander.
Probably somewhat over the top I have ended up using using 10 IR proximity detectors, two looking forwards, two looking back, one looking out each side and four more diagonal front and back, on posts, which were a development to replace front and rear micro switch bumpers that were getting destroyed by the impact forces.
There are also two line following detectors that are looking at the tracks and are used to detect a single white painted link on each side. These are to detect a stalled track and allow an indication of the distance traveled. While it probably will not work in a dirty environment they are fine inside my house. These, along with the proximity detectors are fed as inputs to another 3 MCP23017 ports.
I also have a HMC5883L digital compass raised up on a post at the back to keep it away from interference from the motors and being screened by metal objects like the battery. There is also a 2 line, 16 character I2C LCD display.
Currently it is just running a simple roving and collision avoidance program. It is a fairly simple state machine where the motor drives are derived from the states of the IR detectors. The front & rear horizontal detectors drive left or right turns as do the side detectors which are to make sure there is space to perform a turn. The front & rear bumper detectors, plus the track stall timeouts just put the machine into the reverse direction.
The compass is currently just being used to put the bearing, in degrees, onto the display which is also being used to show the system status to help with debugging.
This all seems to be working well although it does occasionally gets stuck underneath something that is above the detectors but lower that the height of the robot
I think my next challenge is improve it from being a random wanderer into being a better explorer and record directions and distance traveled with a view to generating a map of its current environment.
I am using RiscOs on the RPI so that I could program it in BBC Basic, which is something I used a lot in the 1980s
The only thing I have had to import is an ATN2 function, needed to convert the the compass output to degrees, which is not available in BBC Basic. Acknowledgements for this go to Richard Russel and the Windows BBC Basic forum.
I certainly could not have got this far without the help of this forum and the RiscOc open forum. So lots of thanks.
I hope this makes sense and would welcome any comments.
Glyn