background preloader

LEDs

Facebook Twitter

Digital Addressable RGB LED w/ PWM waterproof flexi strip - (1m) ID: 306 - $35.00. Code Snippet converting HSV to RGB without using floating point. Yesterday I had a problem, in XMOS XC, you are not being able to use floating point and I wanted to convert HSV to RGB, for the easy creation of a spectrum display on a LED string from Adafruit, where you can control every single LED.

Code Snippet converting HSV to RGB without using floating point

The code was tested on a Synapticon Somanet C22 Core Module and seems to run fine.And here it is, the conversion results are nearly the same like on the color selector of GIMP, but due to the integer calculations, there is a lack of accuracy, sometimes it has an error of 3. void setPixelColorHSV(unsigned int n, unsigned int H, unsigned int S, unsigned int V) { if(n < numLEDs && H<=360 && S<=100 && V<=100) { /*INT_HSV2RGB by Christian Holl (www.rad-lab.net) ©2012, License GPL V3 */

Light-emitting diode. Parts of an LED.

Light-emitting diode

Although unlabeled, the flat bottom surfaces of the anvil and post embedded inside the epoxy act as anchors, to prevent the conductors from being forcefully pulled out via mechanical strain or vibration. An LED is often small in area (less than 1 mm2) and integrated optical components may be used to shape its radiation pattern.[5]