How to make use of those RGB Leds with the stamps
Buck Rogers
Posts: 2,186
Hello!
One of the things I explored during my time away from the stamps was the (new to me) creation of the RGB LED. An individual pixel* contains a red one and a green one and then a blue one, with either a common anode, or common cathode. Now I've seen them used to create signage, and driving them was always an interesting turn. Then they were available in of all things, illumination.
At one point I bought one and then got the thing I was using then, to appropriately cycle through colors on it. Now I'm wondering if the same idea can be applied to a device and using the BS2 for the job. The units are either this one https://www.sparkfun.com/products/9264 who is indeed a common cathode variety, or a relative to this one https://www.sparkfun.com/products/10821 which is indeed common anode one. I say related because the original came from Radio Shack. And normally their site isn't normally easy to search but here goes: http://www.radioshack.com/product/index.jsp?productId=3020765&clickid=prod_cs .
Once I understood how they were driven without attached driving electronics, it was using PWM to do that, it was fairly easy.
Now I'm wondering if some of the ideas I never did get to work on that side of things, can be done here. That of having an RGB one change its colors in response to the data being sent to it, rather then just ordinary PWM pulses.
__________
*Picture element. Also most of them contain driver integrated circuits attached. These were the individual LEDs without them.
One of the things I explored during my time away from the stamps was the (new to me) creation of the RGB LED. An individual pixel* contains a red one and a green one and then a blue one, with either a common anode, or common cathode. Now I've seen them used to create signage, and driving them was always an interesting turn. Then they were available in of all things, illumination.
At one point I bought one and then got the thing I was using then, to appropriately cycle through colors on it. Now I'm wondering if the same idea can be applied to a device and using the BS2 for the job. The units are either this one https://www.sparkfun.com/products/9264 who is indeed a common cathode variety, or a relative to this one https://www.sparkfun.com/products/10821 which is indeed common anode one. I say related because the original came from Radio Shack. And normally their site isn't normally easy to search but here goes: http://www.radioshack.com/product/index.jsp?productId=3020765&clickid=prod_cs .
Once I understood how they were driven without attached driving electronics, it was using PWM to do that, it was fairly easy.
Now I'm wondering if some of the ideas I never did get to work on that side of things, can be done here. That of having an RGB one change its colors in response to the data being sent to it, rather then just ordinary PWM pulses.
__________
*Picture element. Also most of them contain driver integrated circuits attached. These were the individual LEDs without them.
Comments
Have you used one before? I have. With the other thing and not the a***d*** one. It had the same form factor as it happens.
So far I've not reached a working decision regarding any of mine but your remarks make sense.
I've lately gone kind of LED crazy.
I don't think there's a simple way of driving a RGB LED directly with a Basic Stamp. I think you could get away with driving a single RGB (or maybe two) with with a Stamp but the code would be pretty awkward. I posted some code in post #19 of this thread which I believe will drive a RGB LED with a wide range of possible colors using a BS2. I haven't tested the code with a BS2 so I'm don't know if it will work or not or if the PWM frequency will be too low and causes a noticable flicker. The values used in the code are intended to produce a white light. You can change the numbers to produce other colors (if the code works (I don't have the Basic Stamp editor installed on this computer)).
Things get a lot easier with a Propeller when driving LEDs.
One of my more recent LED projects use 8x8 RGB LEDs from ebay. I use shift registers to drive the many LEDs. I haven't updated the forum thread with the latest information on this project. I've had some PCBs made that make it a lot easier to drive these arrays. I'm planning on offering these PCB with for sale soon. This is the least expensive way I've found of having a bunch of RGB LEDs.
An even easier (but more expensive) way of driving RGB LEDs is to used strips with WS2801 chips included with the LEDs. I used these strips to add RGB LEDs to my hexacopter.
Another recent LED project used Christmas lights from CostCo. Here's a link to a rather boring demo (of the many thousands of possible colors, I only use two in the demo).
I've just mentioned a few of the many ways to drive RGB LEDs (the ones I have experience with). I haven't ever tried kwinn's method of using 555 chips.
Obviously I'm fond of RGB LEDs and I think they can really add some fun to a project.
Hello!
As it happens these devices are in fact the bare LED, that is without the driver chips, these WS2801 chips. This shop http://www.adafruit.com sells them as individual pixels, with the chips attached. They also sell the strips. Sparkfun http://www.sparkfun.com does also, (the strips not the pixels) they also sell the individual LEDs as well. I bought the three parts that I described earlier from the ITP (NYU Computer store) store here in Manhattan, but they had Sparkfun markings on the bags. However the widget that I alluded to in the beginning was bought from Microcenter in Yonkers, they sold me the BOE Shield for the pest, they also sell some of Parallax's wonders there as well.
Hello!
Well I glommed a copy of the code from that thread's post. And with minor tweaks that the editor insisted upon it tokenized properly. And now to wire it up and then try it out.
Yours is the best idea I've seen so far for making use of these unique devices with the BASIC Stamp.
As I stated earlier a shop (website only) in the city sells pixels wearing WS2801 chips so its possible to make use of the technology properly. My big problem is that those typically use the specialty functions that aren't available with the regular BASIC Stamp.
http://www.adafruit.com/products/322 That there is the first set.
http://www.adafruit.com/products/738 This is the second.
Both are using that driver chip.
If your code works, my next problem is working out how to feed data to the business from the outside.
To use an RGB LED in a BASIC STAMP setup will require an external driving influence.
The flickering in the video was not noticeable to the eye....
@Buck, I think the WS2801 chips should be able to work with the Basic Stamp. The WS2801 uses a clock line so the Stamp could bit bang the data as slow as it pleases and the WS2801 should be able to receive the data. You may have trouble with the update rate if you try to use a bunch at once with a Basic Stamp.
JonnyMac's code make the WS2801 pretty easy to use with the Prop. If you wanted to get the Prop a try I'm sure there'd be lots of people willing to help if you get stuck. (Oh good this isn't the Basic Stamp forum. I'm safe from erco's wrath.)
I know LEDs are supposed to be basic stuff but I still think they're a lot of fun. I'm planning on making a 32x32 RGB LED array (24cmx24cm). I'm thinking it would be fun to use to play retro games like Pong or Breakout on it.