Raspberry Pi code by Simon Monk for the book Programming Raspberry Pi: Getting Started with Python