Demonstrates a number of things per my blog at http://raspberrypirobot.blogspot.co.uk/