I have software on my computer called Dragonframe that allows me to control the RGB LEDs on a light through DMX. I have my Arduino pin 5 connected to an RS-485 module which is connected to my LED light like this:

I made sure my hardware was working by using a serial DMX to USB example program and was able to control all my LEDs through the serial port. However, I need a different lib that uses the ENTTEC protocol for the software on my computer therefore need to the the DMX USB library:
DMXUSB
Using the DMXUSB sample code I posted below I'm able to change the brightness of the LED on my Arduino board without making any changes to the code, so I know the software on my computer can talk to my arduino and my DMX light is set to the right mode but I cannot get the software to control my DMX light. My DMX light is set to DMX mode (D001) which I have confirmed through testing is correct and my PAR light has the following channel mapping:
Channel 1: Master Dimmer
Channel 2: Red dimming
Channel 3: Green Dimming
Channel 4: Blue Dimming
Channel 5: White Dimming (Not used)
Channel 6: Feature selection- strobe, voice control, etc (Not used)
Channel 7: Feature Duration (Not Used)
/* DMXUSB_Simple.ino
* Originally created 11/21/2017 by Stefan Krüger (s-light)
* This is a simple example sketch for the DMXUSB Arduino/Teensy library.
* https://github.com/DaAwesomeP/dmxusb/
*
* Copyright 2017-present Stefan Krüger (s-light)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "DMXUSB.h"
const byte LED_PIN = 13;
// DMXUSB should receive and transmit data at the highest, most reliable speed possible
// Recommended Arduino baud rate: 115200 (limits maximum framerate and/or number of channels
// Recommended Teensy USB baud rate: 12000000 (12 Mb/s)
// DMX baud rate: 250000
// MIDI baud rate: 31250
#define DMXUSB_BAUDRATE 115200
// receive a DMX transmission
void myDMXCallback(int universe, char buffer[512]) {
for (int index=0; index < 512; index++) { // for each channel, universe starts at 0
int channel = index + 1; // channel starts at 0, so index 0 is DMX channel 1 and index 511 is DMX channel 512
int value = buffer[index]; // DMX value 0 to 255
if (universe == 0 && channel == 1) analogWrite(LED_PIN, value); // LED on channel 1 on universe 0
}
}
DMXUSB myDMXUsb(
// Stream serial,
Serial,
// int baudrate,
DMXUSB_BAUDRATE,
// int mode,
0,
// void (*dmxInCallback)(int universe, unsigned int index, char buffer[512])
myDMXCallback
);
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(DMXUSB_BAUDRATE);
}
void loop() {
myDMXUsb.listen();
}
I thought just changing my DMX output pin the output pin going from my arduino to my DMX light is all I would need to do to control my light but I still have no control over my DMX light:
const byte LED_PIN = 5; //the actual DMX data output pin
I thought I needed to add more channels and I tried modifying the code above to change index = 1 and many other things but still have no control over my DMX lights. I found another sample code that builds upon the first code sample by addind channels but still doesn't work for me despite many different code changes:
https://pastebin.com/twLkT6Dy
Most changes were trying:
const byte LED_PIN = 5; //changed to my DMX output data pin
#define NUMBEROFCHANNELS 4
byte ChannelsPins[NUMBEROFCHANNELS] = {1, 2, 3, 4}; ///changed channel order
I was trying to get one channel working at a time by cannot see why I'm not able to talk to my DMX lights. Any suggestions apprecaited.