Using C to control the RGB-LED kit!

Posted: April 30, 2013 in Raspberry Pi, RGB-LED Kit

It is always a pleasure hearing about what people are doing with the kits.

I met Andy and Carlos at the workshop I ran in Bristol (the other week).  Since then they have built their kits and have been experimenting with driving it with C to great success.

Andy has provided a link to the github, where you should be able to download and try the code they’ve created. andywarduk / LEDs on GitHub

If you’ve not used GitHub before, you can browse through the source files directly on the site, as well as download a source zip file by clicking on the little cloud icon on the page.

You can even grab the latest to the Raspberry Pi with the command:


They have used the basic GPIO examples which Dom and Gert (from Raspberry Pi foundation fame) posted on the Raspberry Pi wiki way back (in fact, it may have been me who added it for them…I used to do the wiki for a while).

Andy and Carlos have provided some excellent examples here, called “rainbow”, “shades”, “knightrider”, “coloursweep” and “spectrum”.  I’ll leave you to try them out, see what they do (in case you couldn’t guess) and of course adjust and learn from!  Just follow the instructions in their README file.

I’ve been intending to cover C at some point myself (having time to do so is always an issue), since often C provides that little bit of extra speed which Python can lack (and as you can tell looking at the code, it isn’t a million miles apart from Python syntax).  I highly recommend trying a little C programming, since you will find that many embedded processors can be programmed using code which is complied from C.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s