stephanschulz
Well-known member
i am trying to use DmxReceiver.h and FastLed library together but get this error:
In file included from teensy_dmx_serial.ino:7:0:
/Users/pankow/Documents/Arduino1/libraries/FastLED/FastLED.h:21:2: error: 'DMX' redeclared as different kind of symbol
teensy_dmx_serial:5: error: previous declaration of 'DmxReceiver DMX'
is there a way around this?
thanks,
stephan.
In file included from teensy_dmx_serial.ino:7:0:
/Users/pankow/Documents/Arduino1/libraries/FastLED/FastLED.h:21:2: error: 'DMX' redeclared as different kind of symbol
teensy_dmx_serial:5: error: previous declaration of 'DmxReceiver DMX'
is there a way around this?
thanks,
stephan.
Code:
//this works fine for teensy
#include <DmxReceiver.h>
DmxReceiver DMX = DmxReceiver();
#include "FastLED.h"
//#define USE_SERIAL
//int boardLED = 13;
boolean boardLED_state = true;
//---------------------------------------DMX-------------------------------------
#define DMX_NUM_CHANNELS 15
volatile unsigned char dmx_data[DMX_NUM_CHANNELS];
volatile unsigned char data;
//-------------ws2801--------------
// How many leds are in the strip?
#define NUM_LEDS 15
// Data pin that led data will be written out over
#define DATA_PIN 11
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define CLOCK_PIN 13
// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];
//-----------
int led_vcc_switchPin = 6;
boolean led_vcc_on = false;
void setup(void) {
pinMode(led_vcc_switchPin, OUTPUT);
digitalWrite(led_vcc_switchPin, LOW);
led_vcc_on = false;
//DMX.begin();
#ifdef USE_SERIAL
Serial.begin(115200);
#endif
FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}
void loop(){
#ifdef USE_SERIAL
if (Serial.available()){
handleInput(Serial.read());
}
#endif
if(led_vcc_on == false){
if(millis() > 2000){
led_vcc_on = true;
digitalWrite(led_vcc_switchPin, HIGH);
// digitalWrite(ledPin, LOW);
}
}
DMX.bufferService();
if (DMX.newFrame()) {
for(int i=0; i<DMX_NUM_CHANNELS; i++){
dmx_data[i] = dmx_getDimmer(i+1);
//fadeValues[i] = dmx_data[i]
}
for(int i = 0; i < NUM_LEDS; i++) {
leds[i].setRGB( dmx_data[i], 0,0);
}
FastLED.show();
}
}