LedBorg arrives: time for some pretty GPIO-driven colours

Yeay! I bought a LedBorg recently from PiBorg (only cost a few quid) and it has proven very straightforward to set up and use. LedBorg is essentially 3 LEDs on a very small (as in VERY _small_) expansion board for the Raspberry Pi. It is about the width, and half the length of my index finger making it possibly the teeniest hardware add-on I have every installed.

LedBorg’s LEDs can be set to off, low or high for each of the red, green and blue diodes. In combination this can be used to generate up to 26 colours. The setup instructions are clear and easy to follow. Just make sure that if you have a 512MB Raspberry Pi that you follow the Rev 2 instructions that are on the page.

Changing the colour is as easy as issuing the following from the terminal:
echo “RGB” > /dev/ledborg
replacing RGB with the off (0), low (1) or high (2) value for each of the red, green and blue diodes.

A few examples:

echo “222” > /dev/ledborg
(all LEDs at maximum output)

echo “000” > /dev/ledborg
(all LEDs are off - strictly speaking the LedBorg is not actually outputting black... it is off)

echo “200” > /dev/ledborg

Darker Red
echo “100” > /dev/ledborg
(appears less intense than full Red’s 200)

echo “220” > /dev/ledborg

echo “202” > /dev/ledborg

Ok, so what practical uses can it be put to? Anything from a random colour generator, to colour waves to a CPU usage monitor. In the latter case the demo application that can be installed from PiBorg will change LedBorg’s colour output from Green to Red when the CPU spikes. Here’s an example of a random colour generator that I wrote quickly in Python:

import random, time

while True:
    lbRed = random.randrange(0,3)
    lbGreen = random.randrange(0,3)
    lbBlue = random.randrange(0,3)

    lbColour = str(lbRed)+str(lbGreen)+str(lbBlue)

    LedBorg = open('/dev/ledborg', 'w')
    del LedBorg

    print lbColour

This will pick a random value between 0 and 2 for each of the 3 diodes, set these values, causing the LedBorg to light up accordingly and then print the colour values selected to the terminal. Note that the range is specified as 0,3 as, from tutorialspoint the second value is the stop value and is excluded from the range. Try changing this to 0,2 and you will see that when run the program never output the number 2 (ie: high, LED on maximum) to the terminal. The Python docs do not explain this subtlety.

I have various plans for LedBorg using web.py, AJAX and my Android phone for remote control of my Pi when not connected via SSH and with no monitor plugged in. I can see LedBorg as a very handy gadget to give visual feedback that whatever I set on my Android phone has been so set on the Pi.

PiBorg also make the PiBorg (unsurprisingly), an interesting robot controller for the Raspberry Pi. Here’s a thought: if you cross a LedBorg with a PiBorg do you get a Cylon?

Now with added Pi... 512MB model B's are shipping

Great news from the Raspberry Pi Foundation: Model B Pi’s are now shipping with 512MB as standard. Huzzah we say!

Read more over on raspberrypi.org

Case your Pi part 2: the case arrives and is assembled

This morning I assembled the case that I previously bought from Shropshire Linux User Group via their eBay store.

The case is made from high quality pre-cut acrylic components ready to be assembled. It comes with 8 nuts and bolts to fasten it all together (mine came with 9 - always good to have a spare) and 4 rubber feet. I am a big fan of clear acrylic, as it is very strong and unobtrusive. It is an excellence choice for the casing material.

Read on for assembly instructions (and note those that come with the case, and the YouTube video of the case designers putting the case together).

Using an Android phone as an XBMC remote control

I’ve been a little quiet on the RPi for a week while enjoying XBMC working pretty well. However one thing has been bothering me: a lack of a decent remote control.

Case your Pi

Turns out there are already several case options available for my RPi. I went for one from Shropshire Linux User Group via the eBay link they provide. Cost me a tenner, and should arrive in a few days. I like this one because:

a) it is available NOW (and my RPi looks naked and rather vulnerable at the moment!)
b) it fully enclosed the RPi.

More info on the case when I receive it.


23/05/2012 Update: it arrived! Tomorrow I will have time to assemble it and post a photo.

Raspberry Pi - first hands on moment

Opening the miniscule box that the Raspberry Pi comes in (if it were a plug computer it would challenge them all in the size stakes) myself and those around me at work started making the obligatory “ooo” and “aahh” noises.

The MagPi issue 6 is out

The MagPi issue 6 has been released, featuring an interview written by yours truly with David Hunt of Camera Pi fame. Camera Pi is a superb amalgamation of Pi + DSLR camera that gives David lots of control over the photographic process.