Created
March 2, 2015 16:37
-
-
Save hsiboy/7e23ec783d8b2131133f to your computer and use it in GitHub Desktop.
DMX control of neopixels, WS2811, WS2812 etc using FastLED Arduino Teensy3.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DmxReceiver.h> | |
#include <FastLED.h> | |
#define DMX_NUM_CHANNELS 15 | |
#define NUM_LEDS 15 | |
#define DATA_PIN 11 | |
#define LED_TYPE WS2811 | |
#define COLOUR_ORDER | |
#define CLOCK_PIN 13 // Clock pin only needed for SPI based chipsets when not using hardware SPI | |
CRGB leds[NUM_LEDS]; | |
DmxReceiver myDMX = DmxReceiver(); | |
volatile unsigned char dmx_data[DMX_NUM_CHANNELS]; | |
volatile unsigned char data; | |
void setup(void) { | |
#ifdef USE_SERIAL | |
Serial.begin(115200); | |
#endif | |
FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOUR_ORDER>(leds, NUM_LEDS); | |
} | |
void loop(){ | |
#ifdef USE_SERIAL | |
if (Serial.available()){ | |
handleInput(Serial.read()); | |
} | |
#endif | |
DMX.bufferService(); | |
if (DMX.newFrame()) { | |
for(int i=1; i < DMX_NUM_CHANNELS; i++){ | |
dmx_data[i] = dmx_getDimmer(i); | |
} | |
for(int i=0; i < NUM_LEDS; i++) { | |
leds[i].setRGB( dmx_data[i], 0,0); | |
} | |
FastLED.show(); | |
} | |
} |
I have tried this and I cannot get it to display anything. In fact I'm here because I think that dmxReceiver is incompatible with FastLED when driving WS2801 pixels.
Hello,
Will this code allows to use DMX software to output DMX to USB to Arduino and then control a stripe of WS2812 LEDS ?
thanks
Which DmxReceiver library are you using?
Hi can you tell me where I can downloden the libary please
How to drive ws2811 from dmx file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey awesome, have you used this in a show, did it work well?