CatalogRecent Comments
|
Project: ShiftBriteShiftBrites in stock now. Click here to purchase online.
ShiftBrite is a simple device I am designing and producing. It allows easy control of a bright RGB LED. The interface is a straightforward clocked serial data line and a latch input. All signals are buffered and passed through for good performance over long cables and daisy chaining many devices. Many ShiftBrite devices can be controlled from any type of controller that supports clocked serial data output, which is practically all microcontrollers and even PC parallel port or FTDI bitbang adapters. The above images are renders of the revision 1 design. These were created by exporting PCB images from Cadsoft Eagle, and using the images as textures in a Sketchup model. The controller IC is an A6281 from Allegro. This actually does all the necessary work to control three LED channels. It receives clocked serial data, generates regulated power for its internal logic, performs a 10-bit PWM cycle for each channel, provides current control up to 150ma per channel, and allows dot correction for improving the match between LEDs used together. It buffers the input signals and passes them straight through to the other side of the package. The A6281 is available in a 16-pad 3mm by 3mm package with thermal pad. LEDs are a bright common-anode RGB part purchased directly from China on eBay. The seller is either TopBright or Shop4LEDs, I believe they are the same company. In large quantities, the pricing is very reasonable; in fact, my Chinese contacts were having difficulty sourcing similar LEDs anywhere near the same prices. I am having the circuit board produced by OurPCB. They are also sourcing some of the parts and will assemble the complete devices. I won't post the exact pricing here, but if you have an idea for a device and need it produced, try getting a quote from OurPCB. You will likely be impressed at how low the barrier to entry is for mass-producing custom electronics products. After I have verified the final product, I may be offering these devices for sale. I will most likely be able to price these in the $5.00 range, with discounts for multiple pieces. Additional Information I ordered samples of the A6281 from Allegro, and wanted to test the chips to make sure what I was reading in the datasheet matched reality. I decided to dead-bug wire the chip to a proto board for testing. The images below show some of this process and the results. This method did work just fine, I was able to successfully control a set of LEDs. Prototypes The circuit boards for the prototypes finally arrived, and I assembled some ShiftBrites. The common-anode LEDs from TopBright, I discovered, have an incorrect wiring diagram. The common anode lead is actually to the right of the notch, not below it. Fortunately this only means rotating the LED 180 degrees. The last photo below shows a second ShiftBrite chained to the previous one on a breadboard. Project Status
Submitted by Garrett on Sun, 03/09/2008 - 00:50. |
Sponsors |
Sounds quite much like
Sounds quite much like BlinkM (http://thingm.com/products/blinkm). What is the difference between them? Is there anything that Shiftbrite won't be able to do that BlinkM can or the oposite? A big advantage with your Shftbrite seem to be the price; the BlinkM cost 12.95 $ each.
The first main difference is
The first main difference is that the ShiftBrite uses an inexpensive chip that doesn't require any flash programming during assembly. The BlinkM uses a microcontroller that probably doesn't cost more than $1 or $2 more, but it does have to be programmed before shipping to the customer. These two factors make it possible to get a very low price on completed devices, though I have no idea what that raw cost is for the BlinkM.
The second difference is that an array of ShiftBrites is a series of latched shift registers, rather than BlinkM which is I2C and can be thought of as a star diagram. Since the ShiftBrites are in series, the identity of an LED is defined by its position on the string. The BlinkM requires you to program an address into the LED before it can be uniquely addressed. The BlinkM allows you to send a command to one LED at a time, but the ShiftBrite requires you to command every LED in a string even if you only want to change one. Fortunately the ShiftBrite data clock can be several megahertz, so commanding LEDs should be at least as fast as the BlinkM 100KHz I2C bus. The microcontroller programming require for commanding a ShiftBrite is very simple in comparison to the BlinkM; the user only needs a simple serial clocked shift register and latch pin, and does not need to implement the I2C protocol.
The third main difference is the scripting software and standalone mode of the BlinkM, which don't exist on the ShiftBrite. Typically, someone using a ShiftBrite will get the most value if they want to use three or more on a string, and need to fully control them from their own microcontroller. If you only need one LED and want standalone scripted actions, the BlinkM is more compact and economical than taking a ShiftBrite and adding a dedicated microcontroller. However, this will not be the case in the second version of the ShiftBrite, which will be powering LED currents far in excess of the microcontroller's I/O port maximum.
It sounds like that might
It sounds like that might work as a solution for several applications. I am looking at the robotics aspect and would like to control an RGB led for basic color mixing/brightness from a servo pulse train acting like a virtual servo. This way it would be easy to work with and program. Would this be possible? I know it is not possible with the BlinkM, although they may offer it in a new version.
The BlinkM would most likely
The BlinkM would most likely be a better choice. Mainly because it does use a microcontroller, and you could create custom firmware and reprogram that controller to mix colors based on the pulse-width servo input. The BlinkM and the ShiftBrite won't work with your application out of the box, but the BlinkM could be reprogrammed to do so. You'd need to learn firmware development for the AVR microcontroller.
Awesome! This would be just
Awesome! This would be just what I'd need for a project I've been thinking about for ages. The chip actually does everything I wanted to do by myself... better... ;)
Greetings! While I simply
Greetings! While I simply do not have the vocabulary to understand
very much about your device, I did gather that it can control multiple LEDs. I am wondering if it could be use for a battery operated light system for our Dancing Christmas Tree puppet costumes and 18 foot tall Giant Parade Puppets? Video at http://www.youtube.com/stiltpro
Thank you!
Bill Coleman
ps Found you by way of MAKER
I think it's definitely
I think it's definitely possible, but if many lights are needed the cost could rise pretty fast compared to something like a string of LED christmas lights. Maybe a mix of normal LED strings for fill, and some ShiftBrite element in locations you need programmable patterns and color mixes.
I need this product! Where
I need this product! Where can I buy it? :)
Right here, in about 30
Right here, in about 30 days.
For about $5? What about
For about $5? What about shipping to Europe?
I hadn't planned on doing
I hadn't planned on doing international shipping right away. Mostly because it's more of a pain than domestic shipping, which I can set up in a couple minutes then print a label. I'd have to worry about customs forms, long shipping delays, etc. Also, these devices are not RoHS or CE marked which might pose a problem for European markets.
However, in small quantities I am willing to ship to some European customers. If there's enough overseas demand I will switch to an RoHS process and do what I can to streamline international shipping.
hello, I'm interested in a
hello,
I'm interested in a couple of your devices to make some testing, do you ship them to france? How much would be the total cost?
thanks in advance
Pedro
you might want to consider a
you might want to consider a heat sink to lengthen the lives of your LEDs
The LEDs are only 20ma per
The LEDs are only 20ma per channel. The leads are designed to stand the LED off the board by a few mm, air cooling seems to work fine. The A6281 definitely needs heat sinking, I have the thermal pad connected to a large ground plane and that seems to do the trick. When the thermal pad is not connected, the A6281 hits overtemp and shuts off one of the LEDs. It automatically turns back on when the heat issue is resolved...no need to worry about burning these out!
"you might want to consider
"you might want to consider a heat sink to lengthen the lives of your LEDs"
To get a clue considerer:
How about asking if something was considered before telling someone to considered. And just as expected, the consideration took place long ago. Typical wasteful post.
I would like more
I would like more information on parallel port interfacing. I have a few Kit74 relay boards controlled by Brookshire VSA. It would be nice to be able to control the Shiftbrites this way.
Hi, I'd like to order a few
Hi,
I'd like to order a few of the ShiftBrites. How do I go about it?
Thanks
Steve
The online store is now up
The online store is now up and running. Please let me know if you run into any problems!
Can you tell us how many mcd
Can you tell us how many mcd the LEDs put out at the typical driven current? Trying to figure out how many I'd need to string together to get the effect I'm looking for. Regards.
Hi, Can you clarify what
Hi,
Can you clarify what pins on the LED are what? Referring to the picture of the LED above and your comments, I think what is identified as pin 2 (to the right of the notched corner) is the common anode. Which pin is which color?
Thanks
Steve
That LED pinout is a little
That LED pinout is a little deceptive. If you look at the top view as if it were a bottom view then I believe the pinout is correct.
So, I don't see any
So, I don't see any documentation on the pinout and such of this. Do you have some kind of datasheet that shows which pins on your device map to which pins of the allegro controller?
Soon.....
Soon.....
I would like to see a spec
I would like to see a spec sheet and some example programs, is this coming? When? I was not able to find any on the site to download. I got the allegro doc but it would be nice to see some actual interfacing for an Arduino.
Can you tell me what the
Can you tell me what the operating voltage range and current draw for this is? I'm wondering if I can run it from 5V power available on a USB cable or if I need a separate power supply.
They will draw about 60mA
They will draw about 60mA per device when running at full power on all channels. USB maxes out at 500mA per port, so don't exceed that. The ShiftBrites have an internal regulator that wants over 5.5 volts, but they can run on USB 5V if you bridge the solder jumper provided on the PCB for that purpose.
Thanks for the info, you say
Thanks for the info, you say the low voltage is 5.5v (or 5 with the jumper) what is the max voltage? And is there a particular voltage in that range that's optimal?
The maximum before damaging
The maximum before damaging the chip is 17 volts, but it must regulate the voltage down to about 2-3 volts on each LED. This means that it will dissipate heat until it reaches an overtemperature limit, and shuts down the overheating channel. On these boards, the voltage I've had the best results with is about 7.5; with voltages close to 5.5 you will want to have a surplus of amperage capacity to smooth out any power fluctuations.
I was wondering how to
I was wondering how to control the leds individually in terms of modifying the Arduino code. I see the 1st shiftbrite pass the same data to the one next to it, how do I tell them do be different colors at the same time (one red, one green)?
Since the ShiftBrites are in
Since the ShiftBrites are in a chain, it's necessary to rewrite all the ShiftBrites when one is changed. So, typically you would make an array[num_shiftbrites,3]. Your output routine just indexes through the whole array, shifts out the values that it finds. Maybe cue that on a timer so it happens automatically. To change the color of one LED, now all you have to do is write new values into the appropriate location in the array.
Does anyone have some array
Does anyone have some array based driving code knocked out, preferably for the arduino? My C arrays are rusty.
See if you can make heads or
See if you can make heads or tails of this. Not the most efficient or well documented but does the job and is easy to expand with differnt effects etc. just make a now function and call it from loop.
int datapin = 10; // DI
int latchpin = 11; // LI
int enablepin = 12; // EI
int clockpin = 13; // CI
int chainLength = 4; //Number of ShiftBrites in chain
int image[4][3]; //R,G,B for each ShiftBrite in the chain, first element is No. of SB's in chain
unsigned long SB_CommandPacket;
int SB_CommandMode;
int SB_BlueCommand;
int SB_RedCommand;
int SB_GreenCommand;
void setup() {
pinMode(datapin, OUTPUT);
pinMode(latchpin, OUTPUT);
pinMode(enablepin, OUTPUT);
pinMode(clockpin, OUTPUT);
digitalWrite(latchpin, LOW);
digitalWrite(enablepin, LOW);
SB_CommandMode = B01; // Write to current control registers
SB_RedCommand = 127; // Full current
SB_GreenCommand = 127; // Full current
SB_BlueCommand = 127; // Full current
for (int i=0; i < chainLength; i++) {
SB_SendPacket(); //Send current setup packet to every ShiftBrite
image[i][0] = 0; //Set red to 0
image[i][1] = 0; //Set green to 0
image[i][2] = 0; //Set blue to 0
}
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
}
void SB_SendPacket() {
//Build Packet
SB_CommandPacket = SB_CommandMode & B11;
SB_CommandPacket = (SB_CommandPacket << 10) | (SB_BlueCommand & 1023);
SB_CommandPacket = (SB_CommandPacket << 10) | (SB_RedCommand & 1023);
SB_CommandPacket = (SB_CommandPacket << 10) | (SB_GreenCommand & 1023);
//Send packet
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket >> 24);
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket >> 16);
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket >> 8);
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket);
}
void SB_SendImage() {
for (int x=0; x < chainLength; x++) {
SB_CommandMode = B00; // Write to PWM control registers
SB_RedCommand = image[x][0];
SB_GreenCommand = image[x][1];
SB_BlueCommand = image[x][2];
SB_SendPacket();
}
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delay(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
}
void loop() {
chase();
}
void chase() {
for (int i=0; i < chainLength; i++) {
image[i][1] = 100; //Set new to max
if(i != 0){
image[(i-1)][1] = 0; //Set last to min
}
SB_SendImage();
delay(100);
}
image[(chainLength - 1)][1] = 0;
SB_SendImage();
}
Here's the version I came up
Here's the version I came up with, hopefully it will help someone out, though it seems to flicker at low light levels, anyone have an idea why?
int datapin = 9; // DI
int latchpin = 10; // LI
int enablepin = 11; // EI
int clockpin = 12; // CI
#define chainlength 5
int SB_CommandMode[chainlength];
int SB_BlueCommand[chainlength];
int SB_RedCommand[chainlength];
int SB_GreenCommand[chainlength];
void setup() {
pinMode(datapin, OUTPUT);
pinMode(latchpin, OUTPUT);
pinMode(enablepin, OUTPUT);
pinMode(clockpin, OUTPUT);
digitalWrite(latchpin, LOW);
digitalWrite(enablepin, LOW);
/*
SetSB(1,127,127,127,B01);
SetSB(2,127,127,127,B01);
SetSB(3,127,127,127,B01);
SetSB(4,127,127,127,B01);
SetSB(5,127,127,127,B01);
SB_Refresh();
*/
}
void SB_Refresh() {
for(int led=0;led 24);
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket >> 16);
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket >> 8);
shiftOut(datapin, clockpin, MSBFIRST, SB_CommandPacket);
}
delayMicroseconds(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(1); // adjustment may be necessary depending on chain length
digitalWrite(latchpin,LOW);
}
void SetSB(int led, int red, int green, int blue, int mode){
led=led-1;
SB_CommandMode[led]=mode;
SB_BlueCommand[led]=blue;
SB_RedCommand[led]=red;
SB_GreenCommand[led]=green;
}
void loop() {
int i=0;
for(i=0;i<=1023;i=i+2){
SetSB(1,i,0,0,B00);
SetSB(2,0,i,0,B00);
SetSB(3,0,0,i,B00);
SetSB(4,0,i,0,B00);
SetSB(5,i,0,0,B00);
SB_Refresh();
}
for(i=1023;i>=0;i=i-2){
SetSB(1,i,0,0,B00);
SetSB(2,0,i,0,B00);
SetSB(3,0,0,i,B00);
SetSB(4,0,i,0,B00);
SetSB(5,i,0,0,B00);
SB_Refresh();
}
}
The low level flicker is
The low level flicker is caused by the PWM. The off time becomes to great to trick the eye into thinking that it is actually a solid light so you actually see the modulation. You may even notice this effect in your peripheral vision as you glance across the led at higher levels.
I see that both of you are
I see that both of you are not writing to the control register; you should at least write to it once, since leaving it at zero means the LEDs will be driven with 30% maximum current. And I highly recommend writing to it every time you refresh the PWM registers, or maybe every 10 times. If you ever get interference on the lines, you might accidentally set the control register to an unknown value. So refresh it every so often, to make sure it's in the right state.
You know even playing with
You know even playing with your example the control register codes doesn't seem to work for me, but I'll have another go later today and report back.
Nevermind, this is
Nevermind, this is incorrect, just didn't notice the difference before.
I actually have been testing
I actually have been testing this Arduino code and noticed a flicker too. Mainly, it seems to happen when fading quickly between various colors. I have a theory which I think explains this really well. The A6281 generates its own internal PWM clock, which it uses to vary the intensity of the color. The clock default is 800KHz, which divided by 1024 is about 780 LED updates per second. See where I'm going? The oscillators in each ShiftBrite are free-running, there's no way to know at which point in a PWM cycle you will request a change in brightness. So if you're updating very rapidly, you'll end up jumping into a PWM cycle at random times, resulting in a slight brightness change.
There's two ways to deal with this. First, only update the display when necessary; the longer you wait between updates, the more full PWM cycles will occur and the closer the average brightness of the LED will be to the desired level. Second, the A6281 has a setting to use the data clock as an external PWM source. If your style was really getting cramped by the occasional flicker during fast fades, you could generate your own PWM clocks and sync your color changes to that, always ensuring you have complete PWM cycles.
Can you give us some more
Can you give us some more info on controlling these using the parallel port on a computer or a parallax servo controller board. I was thinking of using these as eyes in a talking skull like the one at skulltronix.com using Brookshires VSA Software.
I don't have PC parallel
I don't have PC parallel port code, I think someone has done it already; but do you have the EFX-Tek controller boards or anything programmable? They have working ShiftBrite code on the EFX-Tek forums. That would be easiest; have a controller that can understand the MiniSSC protocol, and integrate with VSA perfectly.
Edit: I downloaded the Brookshire VSA demo, figured out how to use it, wrote Arduino code to understand MiniSSC commands, and let it control each channel of a ShiftBrite like a servo. Works great! I'll add it to the documentation I need to get on the site.
I've got 33 shiftbrites
I've got 33 shiftbrites working great so-far. The problem with VSA is that it will only supply 8 bits on a parallel port (using their LPT byte mode). So without another device in between the servo controller and the shiftbrites to decode the servo data (Arduino...) you can't. It would be nice to do it without another device and not have to pay extra and do coding for BlinkMs. I hope the documentation will be here soon.
VSA sorely needs some fresh code and a newer gui to match.
Maybe Garrett can work with the VSA folks (Jon) and get a new driver mode going?
Well, using an Arduino seems
Well, using an Arduino seems like a good solution to me. You can program it from any computer with a USB port, the official board costs $33 with other variants approaching the single digits. Brookshire VSA communicates fine over the onboard USB-serial converter. The code to control ShiftBrites is very easy, and the code to understand the MiniSSC protocol is easier. I could make it understand some of the other protocols, which allow more than 256 levels.
I think it works great...and parallel ports are getting really hard to find these days. The Arduino could also do motion control and activate other parts of your project, too.
Yep, but a parallel port
Yep, but a parallel port card or USB to parallel converter is a lot cheaper to add than an Arduino with a USB programming interface. If you've already got the servo controller (a Lynxmotion SSC32 has inputs and 32 servo outputs for $40) there's no need for other controls.
The problem is just that VSA is only setup to support DMX lighting controllers for other than just on/off control.
How many bits of output are you getting from the servo stream?
10?
I forgot that the Lynxmotion
I forgot that the Lynxmotion SSC32 controller already has an ATmega168 on board.
Nice product there. Any idea
Nice product there.
Any idea on when you'll have the docs ready?
I would love to try some USB interfacing with RGB control. Not sure what VSA is but I'll look it up and try to get the demo to play with. Got to get my Diecimila doing something new, maybe I'll actually learn something..hahaha
Or just send me an email it that's quicker/easier.
I would like to see this
I would like to see this also. Using VSA for servo based animations mostly, this would give me another toy(or few) to play with:)
Hello I chained 8 units
Hello
I chained 8 units together and as a quick test I used a couple of 555 timer IC's to generate some pulses. Of course the colors were haphazard however I was able to see the hues propagate down the line. I want to develop a pic based driver as a basic demo unit but I'm not the best or fastest coder and It would probably end up as another unfinished project on the shelf. So there it is. If any young PIC basic programming gurus out there want to tackle this and post some code I'm sure a lot of us would appreciate it.
Thanks
Do you have any details
Do you have any details regarding the controller you plan to use? If your heart isn't set on a PIC, I'd recommend an AVR. Or possibly an Arduino, which is an easy way to get into AVRs. The official USB Arduino Diecimila is only about $35, and there are third-party cheaper versions. Freeduino is $26, some soldering required. I haven't used PICs since the 16F84, but I believe if you can find some code that is designed to work with a shift register, you could easily adapt it.
Hello Again I finally
Hello Again
I finally sat down and patched together 16 Shiftbrites. I tied them into a PIC chip and found some code to drive them at:
http://www.efx-tek.com/php/smf/index.php?action=printpage;topic=620.0
This was written for the Basic Stamp but is very close to the PIC Basic code. This is a good place for PIC users to start since the code is short and clear. The code does uses the word ENABLE as a label which needs to be changed since it is a command word in PIC Basic.
The key to driving the shiftbrites can be found in studying the PIC basic command SHIFTOUT. It will manage all of the Data, timing and variable bit length requirements. You can even embed the two mode setting bits(31-32)to keep things synced. It makes a complicated task very intuitive and hassle free.
Homer J
I ordered a dozen the other
I ordered a dozen the other day. By chance, do you have any without the header pins installed? Thanks.
Is a datasheet available?
Is a datasheet available? Physical dimensions, which Allegro outputs mapped to which colors?
Thanks, I have received my
Thanks, I have received my Order and the shiftbrites are shifting brite :)
If you're doing the next batch I'd recommend to omit the pin headers. If you want to integrate the ShiftBrites into a bigger project they tend to be a hurdle, and desoldering them is way more work than attaching them if you need them (plus the prescision of their soldering is not that great). It also would make shipping and handling a bit easier I'd think.
Additionally there seems to be solder mask between the two pads of the +5V-Jumper on the bottom - it is quite hard to actually connect them with a blob of solder :)
If this could be avoided it would be a bit easier.
Thanks for a great product!
Simon
Can one (or two) of these
Can one (or two) of these plug directly into an arduino? It seems the power and ground could be taken care of by the pins on either side of the four controlling the shiftbrite. Would it have enough current?
Thanks!
Alex
I tried plugging the
I tried plugging the ShiftBrite directly into the Arduino and using I/O pins to supply power and ground. I found that it would cause the Arduino to reset when all three color LEDs were on at a high level.
I think the current draw is too much for the I/O pins to supply, so I changed to a separate power supply. This seems to work reliably, but...
I have also noticed intermittent problems when setting all three colors to the maximum value (1023) to create white light. This seems to work OK for an hour or so, then the LED starts blinking erratically when set to white. All the other colors work fine, as well as setting two colors to maximum and the third to a lower value. Does anyone have an idea why this might be happening? I don't think it's a defective ShiftBrite, since I tried others and they behave the same.
Regards,
Eric
Yes, I also tried plugging
Yes, I also tried plugging it directly into an Arduino and could only power one color at a time, unless I dropped the current for all channels to 1/3rd. This makes sense since each channel draws 20mA which is near the maximum for the I/O ports. You might be able to get more out of the ShiftBrite by using the jumper on the bottom that bypasses the internal regulator, but probably run the risk of damaging the Arduino.
I'm not exactly certain what's going on with your second issue. This is when the device has been running for more than an hour? I doubt it's a data corruption issue; that's a known effect where any noise on the data lines can set configuration registers to invalid values. The solution is to periodically write the configuration registers. However, your problem seems to be time-related. I would suspect heating of the chip. When you touch the ShiftBrite controller, is it very hot? The chip will keep turning itself off if it gets too warm. This can happen if the power supply voltage is high; any excess voltage needs to be dumped as heat by the chip regulator before it goes to the LED channels. I am using 5.5V supplies mainly, what is yours?
Here is some code to use the
Here is some code to use the SPI of an AVR to program the Shiftbrites. It uses the SPI Data and Clock signals to transfer the data, the latching happens via PB1.
void
ShiftOutByte (unsigned char byte)
{
SPCR = (1 << SPE) | (1 << MSTR);
SPSR = (1 << SPI2X);
SPDR = byte;
while (!(SPSR & (1 << SPIF)));
}
#define SB_DAT (0x04)
#define SB_CLK (0x02)
#define SB_LAT (0x01)
#define SB_DELAY 50
void
ShiftOutCmd (unsigned char dest,
unsigned int red,
unsigned int green,
unsigned int blue)
{
unsigned long cmd = dest ? 1 : 0;
cmd = (cmd << 2) | (blue & 1023);
cmd = (cmd << 10) | (red & 1023);
cmd = (cmd << 10) | (green & 1023);
DDRB |= (SB_DAT | SB_CLK | SB_LAT);
ShiftOutByte ((cmd >> 24) & 0xff);
ShiftOutByte ((cmd >> 16) & 0xff);
ShiftOutByte ((cmd >> 8) & 0xff);
ShiftOutByte ((cmd >> 0) & 0xff);
}
void
Latch (void)
{
int j;
for (j = 0; j < SB_DELAY/2; j++);
PORTB |= SB_LAT;
for (j = 0; j < SB_DELAY/2; j++);
PORTB &= ~SB_LAT;
for (j = 0; j < SB_DELAY/2; j++);
}
Note that you need to Latch() if you want the shiftbrites to show the new color.
Hope this helps,
Simon
Post new comment