12V LED strip drives by Rainbowduino

Rainbowduino isn’t only  used to drive the LED matrix but also can be used to drive other things like: LED strip or motor.

Now here’s a  demo using Rainbowduino to drive LED light strip for showing the numbers.

We used 7 strips to make up a number character. And connect the LED strip to Rainbowduino pins .Hook up the RGB pins of light strip to RGB pins of Rainbowduino respectively and the anode of light strip to the VCC of Rainbowduino.

Program the code bellows into Rainbowduino and you can see the number display form 0 to 9 .

 

#include "Rainbow.h"
unsigned char NumTab[10]=
{
  0x77,0x06,0x5b,0x1f,0x2e,0x3d,0x7d,0x17,0x7f,0x3f
};
void setup()
{
  _init();
  close_all_line
  open_all_line
}
void loop()
{
  int i;
  for(i=0;i<10;i++)
  {
    shift_24_bit(NumTab[i],0,0);
    delay(500);
  }
}
void _init(void)    // define the pin mode
{
  DDRD=0xff;
  DDRC=0xff;
  DDRB=0xff;
  PORTD=0;
  PORTB=0;
}
void shift_1_bit(unsigned char LS) 
{
  if(LS) shift_data_1;
  else  shift_data_0;
  clk_rising;
}
void shift_24_bit(int Red,int Green,int Blue)  
{
  unsigned char i;
  le_high;
  for (i=0;i<8;i++)
  {
    if ((Green<<i)&0x80)   shift_1_bit(1);
    else                 shift_1_bit(0);

  }
  for (i=0;i<8;i++)
  {
    if ((Red<<i)&0x80) shift_1_bit(1);
    else          shift_1_bit(0);
  }
  for (i=0;i<8;i++)
  {
    if ((Blue<<i)&0x80)  shift_1_bit(1);
    else             shift_1_bit(0);
  } 
  le_low;
}

More info about “3W RGB LED strip” http://www.seeedstudio.com/depot/3w-rgb-led-strip-common-anode-12v-p-351.html

About Author

Calendar

July 2009
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031