Posts

Showing posts with the label dotstar led

Raspberry Pi and Dotstar LED Jukebox

Image
A little while ago I made a media centre for some friends, which had hardware audio playback controls. Much as I love giving people things, I was a bit jealous because it was pretty cool thing (even if I do say so myself). When the opportunity came up to make one for our upcoming wedding, I jumped at the chance, and added a few features extra to the original design. A little time scouring the internet for parts and then, time to assemble: First up, out with the ironing board (soldering iron is an iron, right?). The dotstar LEDs run at 5v and the Pi's GPIO outputs at 3.3v, so we need a level shifter/bus buffer to bump the volts up a bit. Terrible messy circuit "diagram", but it worked. You can see the LED layout down at the bottom, there are six pins on each one - power, ground, clock in, data in, clock out, data out. This means they can be chained and addressed individually by software. They're pretty smart little things. Dotstars are new and a little more f...

Dotstar LEDs with Raspberry Pi - the Python bit

In this post , I showed how I made my Raspberry Pi jukebox. Here's how it is controlled. At it's core, it's just a python script which waits for interrupts from the Pi's GPIO pins. That's the easy bit (although it would be a lot easier if there wasn't two different ways to number GPIO pins - I mean really...) I do know that just making a bunch of functions isn't particularly pythonic and I should probably do something with classes and objects and stuff, but I had a really immovable deadline on this project so I just stuck with what I knew (which mostly comes from php, years ago). Adafruit provide a library to let you access the Dotstar leds, but it's pretty basic. That's cool, it was fun learning how to figure stuff out. I ended up using a couple of modules to generate colour gradients and to shift between various colourspaces. A nifty thing happened when I wanted to flash random, but bright colours as part of rave mode. Taking random RGB va...