ShiftBrite

ShiftBrite control class using SPI

Hello World

Import programShiftBrite_HelloWorld

ShiftBrite control class Hello World program

Library

Import libraryShiftBrite

ShiftBrite control class using SPI

Datasheet

http://docs.macetech.com/doku.php/shiftbrite_2.0

Notes

/media/uploads/jwaters9/10075-01b.jpg

Details

The ShiftBrite module is a bright RGB LED on a breakout board with header pins that has an Allegro A6281 3-channel constant current LED driver. The modules use an SPI interface with 10-bits per color. They are buffered for the option of chaining the modules together. ShiftBrites can be purchased from Sparkfun, Pololu, or directly from Macetech. More details on the module can be found here.

Schematic

/media/uploads/jwaters9/table.png /media/uploads/jwaters9/shiftbritepin.jpg

Example

Import program

00001 #include "mbed.h"
00002 #include "ShiftBrite.h"
00003 
00004 //ShiftBrite Demo
00005 //DigitalOut latch(p15);
00006 //DigitalOut enable(p16);
00007 //Cycles through different colors on RGB LED
00008 SPI spi(p11, p12, p13);
00009 
00010 ShiftBrite myBrite(p15,p16,spi); //latch, enable, spi
00011 
00012 int main() {
00013 int r,g,b;
00014 r=g=b=50;
00015     
00016     while(1) {
00017         myBrite.Write(255,255,255);
00018         wait(0.5);
00019         myBrite.Write(0,0,255);
00020         wait(0.5);
00021         myBrite.Write(0,255,0);
00022         wait(0.5);
00023         myBrite.Write(255,0,0);
00024         wait(0.5);
00025         
00026         myBrite.Brightness(r,g,b);
00027         if(r<1023)
00028             r+=50;
00029         else
00030             r=50;
00031         g=b=r;
00032         
00033     }
00034 }

Video


You need to log in to post a discussion