Using Uno with DMX Shield

Hey guys,

So I am trying to control a dmx fixture using my Arduino Uno here, and I've purchased a shield for it, which can be found here. Apparently the library that comes with it is garbage, so people recommend using DmxSimple.

Since I still wanted to have serial access to the Uno, I am using pins 3 and 4 instead of 0 and 1. Unfortunately, this doesn't seem to work. My fixture never receives any valid DMX commands. It should be noted with this board that there are various jumpers on it, and so I have them set as follows:

EN <-- EN(with line on top)
Slave --> DE
TX-io <-- TX-UART
RX-io <-- RX-UART

Now, I have tried researching this a bit on the forums here, but I didn't find much that was relevant or actually included a solution.

Below is my code:

#include <DmxSimple.h>

void setup() {
  Serial.begin(9600);
  pinMode(2,OUTPUT);
  digitalWrite(2,HIGH);
  DmxSimple.usePin(4);
  DmxSimple.maxChannel(24);
}

int oldVal = 0;
void loop() {
  int val = analogRead(A0);
  if ((oldVal - 15 > val || oldVal + 15 < val) && oldVal != val) {
    Serial.println(val/4);
    for (int i=1;i<=24;i++) {
      DmxSimple.write(i, val/4);
    }
    oldVal = val;
  }
}

Basically what I'm trying to do here is read the value of a pot and set DMX values accordingly. Reading the pot works fine, and provides suitable values (I just have to divide it by 4 to match the 256 scheme of DMX).

Let me know if you guys have any suggestions as to how to get this whole thing to work.

Thanks!
Emanuel

(PS, I know I already posted in another thread, but it was in the wrong sub forum and I couldn't find how to move it.)

I have not looked at your board in detail but software serial on pins 3/4 will not work at the baud rate DMX uses (250000 baud) and as the UNO has only one UART port it has to use pins 0/1.
Even if you decide to try using a MEGA with 4x UART ports then AFAIK you cannot mix DMX and Serial as the DMX libraries tend to take over all UART interrupts.
All is not lost though as I use Leonardo clones with the 32u4 MCU and DMXsimple with connection to DMX and Serial USB at the same time without issue (see here).