Not good, especially if you’re dealing with long LED strips or a matrix of RGB LEDs powered by USB. Which means that every composite color (yellow, cyan, magenta) consumes two times more current than a base one (red, green, blue). With RGB LED it means that both red and green diodes are fully on. As the model was made to contain every possible color, it considers yellow (HSV = 60, 100, 100) to have both red and green of the RGB model at maximum (255, 255, 0). See the picture with normal HSV graph above. Seems like producing a rainbow with it is the easiest thing imaginable: the simple for (int k=0 k<360 k++) cycle will do the trick. Which leaves us with Hue: a nice circle containing all the colors of a rainbow in a neat 0-360° sequence. At 50% they look almost the same as at 100%, which, in fact, is very good, because it helps control power consumption. Thus the use of Value in HSV model with RGB LEDs is limited to setting global brightness, fadeouts and transitions all this can be easily done in RGB by simple simultaneous division applied to each channel.Īnother thing that makes HSV Value/Brightness useless with LEDs is the fact that diodes, unlike computer monitors, are not calibrated, and are slow their brightness is not linear. Same with LEDs: even if you have a bunch of them, they are still separate. You see deep dark red on the screen because there are different colors present there try to fill it with dark red entirely, turn off all the lights and you’ll see a red rectangle you won’t be able to tell whether it’s ‘burgundy’ or ‘scarlet’ due to absence of any reference. Do the same with LEDs and you’ll get the same red and yellow colors, just a bit dimmer there’s no such thing as a ‘brown LED’. Lower brightness in red (H=0) and you get burgundy, lower brightness in orange (H=40) and get brown. With Brightness you can achieve some dark colors on screen. But with LEDs you don’t want pastel colors (they look just like different shades of white, in fact): you need your colors as bright and clear as possible, so Saturation is at 100% almost all the time (excluding the animation/transformation moments, but they are done with algorithms more on that later). Saturation can be used to produce soft, pastel colors, without the complex calculations needed with RGB model. And what’s more, two of these values are almost useless when dealing with LEDs, because they are made for complex hi-res designs, not single pixels (aka RGB LEDs). Saturation and Value are measured in percents (0 to 100). Hue is a circle, it has values from 0 to 360. HSV stands for Hue, Saturation and Value (or Brightness). It’s just way better suited for light-emitting sources! However, as with all the other universal solutions, some constraints are imposed, thus, people who work exclusively with printed designs have to rely on CMYK, and people dealing with LEDs are better off with the RGB model. Thus HSV is pretty useful for graphic designers -they can do everything in one model and be reasonably sure that the result will look the same on the screen and on paper. These worlds are very different: for example, mixing red and green on the screen results in pure yellow, but try mixing them on paper and you’ll get a dirty blot. The most important HSV achievement is bringing together two color worlds: the light-emitting one (RGB) and the light-reflecting one (CMYK). If you want to get to the sketches ASAP, you may skip to the second step now. You’ll need just an Arduino and an RGB LED to run the sketches present.īut first, let’s deal with the HSV. Here you’ll learn of different possible approaches to an RGB rainbow, random colors and their transitions, as well as some bits on the usefulness of a sine wave and lookup tables. Here it goes, hopefully it’s not too late for some of the readers to make some quick Christmas lights. In any case, one of the readers asked for a code in my previous instructable dealing with RGB LED strips connection to an Arduino, and I promised an article. What’s better suited to control such a thing than the red, green and blue color model? Why complicate matters by additional algorithms converting data from a very different set of rules to the native one? Still, HSV persists it’s even present in an excellent ShiftPWM library. Really, people! An RGB LED consists of three LEDs: red, green and blue. The most common strangeness is the use of the HSV color model for RGB LED programming. However, time and again I come upon projects using strange approaches to this matter. It would seem that such simple things as a rainbow effect or smoothly changing random colors on an RGB LED are pretty trivial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |