Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: Arduino code to drive Octobrite LEDs on: September 25, 2009, 03:14:38 pm
Nice I love the way those color ramps look.

I altered the code slightly and used it to drive some more subtle color animations for this picture frame:

2  Forum 2005-2010 (read only) / Interfacing / Re: Arduino code to drive Octobrite LEDs on: June 09, 2009, 04:04:57 am
You did a great job on that board -- it's a thing of beauty! Everything is so tiny and the silkscreen is very cool.

I'm thinking of using it as a backlight for a picture frame. Hopefully I'll get some time next week to work on it.

The form factor and how light it is might also suggest a POV application...
3  Forum 2005-2010 (read only) / Interfacing / Arduino code to drive Octobrite LEDs on: June 08, 2009, 03:42:43 am
I picked up an Octobrite from at Maker Faire last weekend and finally got around to trying it out. Here's some code that works for a single Octobrite, and should work for multiple daisy-chained together as well.


* Octobrite Test
* 6/8/2009 -
* Cycles a continuous color cycle through the 8 leds

// Color channel constants
#define RED 0
#define GREEN 1
#define BLUE 2

// TLC5947 maintains 12 bits of grayscale per LED channel
#define CHANNEL_BITS 12
#define CHANNEL_MAX ( (1<<CHANNEL_BITS) - 1)

// TLC5947 pins
int SIN_PIN = 8;
int SCLK_PIN = 9;
int BLANK_PIN = 10;
int XLAT_PIN = 11;

// Interpolation constants
int lerpsteps = 5;
int stepdelay = 25;

int lerpindex = 0;

// Color table and current/prev color state. The interpolation looks
// best when only one channel is changing during an interpolation
// between a pair of adjacent colors.
int colorCount = 6;
int clutred[6] =   { 1, 1, 0, 0, 0, 1};
int clutgreen[6] = { 0, 0, 0, 1, 1, 1};
int clutblue[6] =  { 0, 1, 1, 1, 0, 0};
int currentColorIndex = 0;
int previousColor[3];
int currentColor[3];

void setup()
  // Setup TLC5947 pins
   pinMode(SIN_PIN, OUTPUT);
   pinMode(SCLK_PIN, OUTPUT);
   pinMode(BLANK_PIN, OUTPUT);
   pinMode(XLAT_PIN, OUTPUT);

   // Turn off all LEDs
   digitalWrite(BLANK_PIN, HIGH);
   // Default state for clock and data latch
   digitalWrite(SCLK_PIN, LOW);
   digitalWrite(XLAT_PIN, LOW);
   // Init comms for debug info
   // Reset color state
   currentColor   = clutred[currentColorIndex];
   currentColor = clutgreen[currentColorIndex];
   currentColor  = clutblue[currentColorIndex];
   // And write the colors to the octobrite
   // Finally enable the LEDs
   digitalWrite(BLANK_PIN, LOW);

// Called when we've completed an interpolation between a pair of
// colors. This sets us up to interpolate to the next color in
// the lookup table
void NextColor()
  // We've finished interpolating to the current color, so it becomes the
  // previoud color we're interpolating from
  previousColor   = currentColor;  
  previousColor = currentColor;  
  previousColor  = currentColor;
  // And pick the next color in the CLUT for the current color
  currentColorIndex = (currentColorIndex + 1) % colorCount;
  lerpindex = 0;
  currentColor   = clutred[currentColorIndex];
  currentColor = clutgreen[currentColorIndex];
  currentColor  = clutblue[currentColorIndex];

// Writes out a single 12-bit grayscale channel
void WriteChannel(int value)
  int bit;
  // Write value, MSB first
  for (bit=11; bit>=0; --bit)
    if (value & (1<<bit))
      digitalWrite(SIN_PIN, HIGH);
      digitalWrite(SIN_PIN, LOW);
    // We need to wait 30ns after writing data before clocking it in.
    // Fortunately, our AVR is slow enough that we don't need to
    // do an explicit wait here
    digitalWrite(SCLK_PIN, HIGH);
    digitalWrite(SCLK_PIN, LOW);

void WriteColors()
  // First calculate the current interpolated color value
  int red   = (CHANNEL_MAX*previousColor*(lerpsteps-lerpindex)   + CHANNEL_MAX*currentColor*lerpindex) / lerpsteps;
  int green = (CHANNEL_MAX*previousColor*(lerpsteps-lerpindex) + CHANNEL_MAX*currentColor*lerpindex) / lerpsteps;
  int blue  = (CHANNEL_MAX*previousColor*(lerpsteps-lerpindex)  + CHANNEL_MAX*currentColor*lerpindex) / lerpsteps;
  // Disbaled debug output
  if (false)
    Serial.print(", ");
    Serial.print(", ");
   // Now write the next RGB value, which will shift the colors
   // down along the other LEDs
   // Finally latch in the new color values
   digitalWrite(XLAT_PIN, HIGH);
   digitalWrite(XLAT_PIN, LOW);

void loop()
  // Step the interpolation by one frame
  if (lerpindex > lerpsteps)
    // We finished the interpolation between the current
    // color pair. Set up the next color pair.
  // Update the LEDs

  // Throttle the animation

4  Forum 2005-2010 (read only) / Exhibition / Re: ShiftBrite Electric Eye on: May 24, 2009, 03:43:33 am
Video and source here:

I'm really enjoying the ShiftBrite modules. There's a ton of potential with them and they're very easy to use.
5  Forum 2005-2010 (read only) / Exhibition / ShiftBrite Electric Eye on: May 24, 2009, 03:42:40 am
My first arduino project is a 3x3 matrix of ShiftBrite LEDs and an ultrasonic rangefinder. It's a proximity-triggered light show.
6  Forum 2005-2010 (read only) / Exhibition / Re: Scrolling LED Traffic Sign, Hack to Warn of Zombie on: November 02, 2009, 05:54:56 pm
Very nice. I'm a big fan of the sure LED matrices as well. I couldn't really tell from the video, but what is the enclosure made out of?

7  Forum 2005-2010 (read only) / Exhibition / Re: Arduino Etch A Sketcher on: December 31, 2009, 08:12:22 pm
I considered your suggestion on trying to minimize direction changes, but it doesn't work for a lot of images. Since you can't "pick up" the pen to make it not draw, you can end up with lots of unwanted lines connecting things. I've done some work to reorder the points in the SVG documents to start and end polygons/paths on points in common with other polygons/paths and it improves things somewhat.

The other strategy is do create images that require minimal direction changes like you suggest, and also create them in a way where it's a single contiguous path to avoid the "pen up" problem. I'm trying this out for something to sketch photographs:

It will travel all the way from top to bottom doing one column and then bottom to top for the next column. With each step vertically it draws a width proportional to the brightness of the pixel at that spot.

Surprisingly, it seems a good strategy to change directions frequently as it does for the line widths. Since what it's doing is moving half the width left, then right, then back to center the errors appear to cancel out. Still a work in progress, but looking hopeful.

8  Forum 2005-2010 (read only) / Exhibition / Arduino Etch A Sketcher on: December 30, 2009, 02:23:06 pm
Lots of folks have done these, including me -- this is my second or third try. When I first started doing Arduino projects this year I expected to learn about electronics. I didn't realize how much I'd end up learning about mechanical design issues, which was the biggest hurdle to getting this working well.

Full set of build pictures at

In mechanical devices, just like software, simplicity rules over all. So this newer version tries to optimize for fewer parts and maximum rigidity.

9  Forum 2005-2010 (read only) / Exhibition / Spookotron Pumpkin Light on: November 02, 2009, 12:43:30 pm
Not wanting to be left out of the fun, for Halloween I made an an Arduino controlled pumpkin light using some ShiftBrite RGB LEDs.

Details at:

Source code at

10  Forum 2005-2010 (read only) / Exhibition / Re: LED matrix + OLED panel Facebook "wall" on: September 26, 2009, 11:53:30 am
I purchased them from eBay seller "sureelectronics". They are $10 and they ship free, but since they come from China it can take a couple weeks.

Here are the 24x16 panels:

And other sizes they carry:

I've used the 32x8 ones as well. They have the same driver chip and you can daisy chain both sizes and control up to 4 of them with just 3 arduino output pins.
11  Forum 2005-2010 (read only) / Exhibition / LED matrix + OLED panel Facebook "wall" on: September 24, 2009, 01:23:40 am
I discovered some inexpensive LED matrix panels on eBay from Sure Electronics -- there are threads elsewhere in the forums on these. Since they have a nice serial protocol to control them, they were perfect to do some wall signs.

Haven't designed an enclosure for this one yet, but it pulls entries from my twitter feed and shows the person's picture on the OLED and then scrolls the tweet text in the LED display:

This one combines a few sizes of the LED matrix parts into a laser-cut acrylic enclosure. Driving the LEDs is really simple and the parts are cost-effective.

The OLED panel is from Sparkfun. It's cool but you talk to it through a fairly slow serial link so it takes a long time to push the images to it. Fortunately you can add a microSD card to it and cache the images there so subsequent displays are quick.

12  Forum 2005-2010 (read only) / Exhibition / Octobrite Picture Frame on: July 19, 2009, 04:10:31 am
The MaceTech Octobrite modules fit perfectly in an Ikea 5x5" Ribba frame. I used it to make an edge-lit acrylic photo frame and it came out pretty nice.

I like how compact the Octobrite modules are and they only take up 4 digital outs so you can easily combine them with other things.

Pages: [1]