Clockatoo Clock Board says Hello World
If you've not heard of the Geekroo Clockatoo, and tend to use your Pi for network related things (website hosting, IRC bouncers, DNS/mail server), then I'd like to introduce the Clockatoo as the one thing you should have permenantly seated on your Pi.
Why? Because it's a clean, simple and very elegant put together way of getting some basic visual feedback from your Pi.
The Clockatoo combines a simple 4-digit, 7-segment display with a Real-time clock, an alarm buzzer and an optional ( meaning you're going to need to solder headers onto both your Pi and the Clockatoo ) Pi reset button.
All the complexity of driving a 7-segment display is abstracted away with a driver chip that you can interface over i2c. Geekroo provide an example library in Python which grabs the system time and displays it on the display.
One of the obvious omissions from Geekroo's own library is text. If you think you can't display text on a 7-segment display, you'd be wrong. The human-brain should never be underestimated, and it's marvellous just how distorted a set of characters we can readily, and easily understand.
Back when I was first tinkering with electronics I drove a 7-segment display from the Pi with a couple of shift registers, some transistors and a darlington array. I'd mapped a set of letters which displayed fairly comfortably on 7 segments. It made sense to port this to Clockatoo.
So, I've modified the Clockatoo library to include text support and a basic hello world/uptime example. As demonstrated in the example, displaying text is now as simple as:
from Raspi_7Segment import SevenSegment
delay_seconds = 0.2
segment = SevenSegment(address=0x70)
The delay controls the speed at which characters scroll off to the left. 0.2 seconds is a comfortable speed.
I also decided to play with the buzzer on the Clockatoo. Documentation is still scant, but with a bit of trial and error I found it on WiringPi pin 7 ( GPIO pin 4 ) and had it making infuriating noises in no time with WiringPi's softTone functions. You can find a demonstration of this on my Pinout microsite at: http://pi.gadgetoid.com/pinout/clockatoo
The real-time clock is the last thing I plan to play with. It's not actually needed or even used in the basic Clockatoo examples, and is generally most useful with Pi's that are not connected to the internet.
My plans for the Clockatoo are simple; it'll stay permenantly connected to the Pi hosting this blog. In fact, at the moment it's stacked on top of the 1-Wire board from ABElectronics.co.uk so I can use the display to provide notifications of my blog status, the ambient temperature, the time, tweets to it's own Twitter account and more!
Note: Yes, you can stack the Clockatoo on top of ABElectronics boards, but it's a little awkward! Any board using I2C that doesn't use address 0x70 ( the LED display ) or 0x68 ( the realtime clock ), or GPIO pin 4 should be fine.
You can get yourself a Clockato from Modmypi.com.