Hey everyone, Would it be possible to use fastled to send out dmx?

Hey everyone,
Would it be possible to use fastled to send out dmx?
For example, I’ve written a fastled arduino program and would like to keep the program as it is but the use dmx output to control big dmx controllable lights. I’m using a https://www.tindie.com/products/Conceptinetics/dmx-shield-for-arduino-remote-device-management-capable/

Question two, does somebody has a function to convert HSV (0-255) values to RGB (0-255) values?

The best, Jonas
https://www.tindie.com/products/Conceptinetics/dmx-shield-for-arduino-remote-device-management-capable

For question two, is this what your looking for?
http://fastled.io/docs/3.1/hsv2rgb_8h_source.html

https://github.com/FastLED/FastLED/blob/master/hsv2rgb.cpp

Found Mark’s post on this…
https://plus.google.com/112916219338292742137/posts/Rxx6RpgpSr2

Yep, FastLED supports (simple) DMX output, and has built-in HSV-to-RGB conversions.

Thanks Marc, thanks, that’s what I’m looking for but don’t understand how to use it?
Hey Mark, how can we use it? Can’t find any documentation about this. The dmx parameter is not accepted?

Yeah, I’m looking at that now. Also it looks like the DMXSimple library that I have is a bit out of date.

I’ll see if I can figure out what’s needed and offer up some sample DMX code; I have to admit I’m rusty – haven’t done FastLED + DMX in about two years, but it does work. It may need some tweaking; I’ll check over this weekend.

As for the HSV to RGB conversion, it’s pretty much automatic and built in

CHSV myHSVColor( 160, 255, 255); // yellow

CRGB rgbcolor;

rgbcolor = myHSVColor; // conversion is automatic

For more on FastLED pixels and colors, see

and

I’ll take a look at the DMX situation over the weekend.

Thanks Mark, HSV to RGB is working now, just messed up the syntax.

And Mark, it would be awesome to hookup dmx lamps with fastled!

For those who are interested in a working work around for this dmx controller here is what I’ve got so far

#include <Conceptinetics.h>
#include <FastLED.h>

#define ROWS 4
#define COLS 8
#define NUM_LEDS ROWSCOLS
#define DMX_MASTER_CHANNELS NUM_LEDS
3
#define RXEN_PIN 2
#define DATA_PIN 11
#define CLOCK_PIN 13

CRGB leds[NUM_LEDS];
DMX_Master dmx_master ( DMX_MASTER_CHANNELS, RXEN_PIN );

uint8_t hue = 183;
uint8_t sat = 128;
uint8_t val = 255;
uint8_t fadeouttime = 100;
uint8_t varHorizontal = 100;
uint8_t varVertical = 100;
boolean vertical = true;
const bool serpentinelayout = false;

void setup() {
delay(2000);
dmx_master.enable();
FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

void loop() {
hue++;
knightrider();
FastLED.show();
senddmx();
delay (20);
}

void senddmx(){
for(int i=0; i < NUM_LEDS; i++) {
setLight(i, leds[i].r, leds[i].g, leds[i].b);
}
}

void setLight(uint8_t led, uint8_t red, uint8_t green, uint8_t blue){
dmx_master.setChannelValue (led3+1, blue );
dmx_master.setChannelValue (led
3+2, red );
dmx_master.setChannelValue (led*3+3, green );
}

uint16_t XY(uint8_t x, uint8_t y){
uint16_t i;
if( serpentinelayout == false) {
i = (y * COLS) + x;
}
if( serpentinelayout == true) {
if( y & 0x01) {
uint8_t reverseX = (COLS - 1) - x;
i = (y * COLS) + reverseX;
}
else {
i = (y * COLS) + x;
}
}
return i;
}

void knightrider(){
int x = beatsin16(varHorizontal,0,COLS);
for( byte y = 0; y < ROWS; y++) {
leds[ XY(x, y)] = CHSV( hue, sat, val);
}
fadeToBlackBy( leds, NUM_LEDS, fadeouttime);
}

I won’t be back at a laptop until tomorrow but FastLED supports two underlying dmx libraries for dmx output. If you haven’t worked out how to use it by then I’ll fill in more tomorrow.

Would be awesome to see more :wink:

It depends on what library you’re using, right now the two supported libraries are DMXSerial and DmxSimple – but you just add leds the same way you do with any other chipset:

LEDS.addLeds<DMXSIMPLE, DATA_PIN, RGB>(leds, NUM_LEDS);

or

LEDS.addLeds<DMXSERIAL, RGB>(leds, NUM_LEDS);

and be sure #include DmxSimple.h or DmxSerial.h before you include FastLED.h.

Ah! that’s some useful info. Used DMXsimple in the past so I’ll try that :wink: thanks

please provide sample program code for simple color wipe code using dmx output. how to set master and slave arduino’s using dmx

@Jonas_Vorwerk how to connect after running this program to ws2811 led pixels

@Jonas_Vorwerk i have fastled program and i know how to connect the strip to arduino uno but i dont know how to deal with dmx

@Vijay_Kumar2 Sorry for my super late response, did you manage already? You should checkout the dmx simple library.

please let me know the details about sending dmx signal as well as connections alos

Depend on what you are using. for example:

void senddmx(){
for(int i=0; i < NUM_LEDS; i++) {
setdmxlight(i, leds[i].r, leds[i].g, leds[i].b);
}
}

void setdmxlight(uint8_t led, uint8_t red, uint8_t green, uint8_t blue){
dmx_master.setChannelValue (led3+1, blue );
dmx_master.setChannelValue (led
3+2, red );
dmx_master.setChannelValue (led*3+3, green );
}

please provide some simple example like chasing or any effect with complete code. so that i can understand