#include DmxReceiver dmx; IntervalTimer dmxTimer; int DMXstartChannel= 0 ; const byte DMXadressPins[8] = {11, 12, 14, 15, 16, 17, 18, 19}; #define PWMnumChannels 10 const int PWMchannels[PWMnumChannels] = {3, 4, 5, 6, 9, 10, 20, 21, 22, 23} ; #include //const int NUM_LEDS_1 = 90; const int LEDS_GROUP_1 = 6 ; const int LEDS_OFF_1 = 2 ; const int NUM_GROUPS_1 = 10 ; #define DATA_PIN_1 7 CRGB leds_1[NUM_GROUPS_1*(LEDS_GROUP_1+LEDS_OFF_1)]; //const int NUM_LEDS_2 = 50; const int LEDS_GROUP_2 = 6 ; const int LEDS_OFF_2 = 2 ; const int NUM_GROUPS_2 = 5 ; #define DATA_PIN_2 8 CRGB leds_2[NUM_GROUPS_2*(LEDS_GROUP_2+LEDS_OFF_2)]; void dmxTimerISR(void) { dmx.bufferService(); } //----------------------------------------------------------------------------- void setup() { Serial.begin(9600); delay(2000); // Instead of while (!Serial), doesn't seem to work on Teensy Serial.println("Starting."); FastLED.addLeds(leds_1, NUM_GROUPS_1*(LEDS_GROUP_1+LEDS_OFF_1)); FastLED.addLeds(leds_2, NUM_GROUPS_2*(LEDS_GROUP_2+LEDS_OFF_2)); FastLED.show(); dmx.begin(); dmxTimer.begin(dmxTimerISR, 1000); //Calculate DMX adress DMXstartChannel = 0; for(int i=0; i<8; i++){ pinMode(DMXadressPins[i], INPUT_PULLUP); } delay(200); for(int i=0; i<8; i++){ DMXstartChannel += (!digitalRead(DMXadressPins[i]) * pow(2, i)); } DMXstartChannel += 256 ; Serial.print("DMX start adress set to : "); Serial.println(DMXstartChannel); } //------------------------------------------------------------------------------ void loop() { //Calculate DMX adress // Serial.println(DMXstartChannel); if (dmx.newFrame()) { // 10 first channels are for power led dimmers for (int i=0; i