OPTA and DMX with Integrated RS485 Hardware

I want to control LED lights using the DMX protocol and the integrated RS485 hardware of OPTA.
I found the ArduinoDMX.h library with its example code, but I haven't achieved any results. (I tried using a 120-ohm resistor).

I think the problem might be figuring out which pins the RS485 hardware is connected to.

Does anyone have any ideas why it’s not working?

/*
  DMX Blink

  This sketch toggles the value of DMX channel 1 between 255 and 0.

  Circuit:
   - DMX light
   - MKR board
   - MKR 485 shield
     - ISO GND connected to DMX light GND (pin 1)
     - Y connected to DMX light Data + (pin 2)
     - Z connected to DMX light Data - (pin 3)
     - Jumper positions
       - Z \/\/ Y set to ON

  created 5 July 2018
  by Sandeep Mistry
*/

#include <ArduinoRS485.h> // the ArduinoDMX library depends on ArduinoRS485
#include <ArduinoDMX.h>

const int universeSize = 16;

void setup() {
  Serial.begin(9600);
  while (!Serial);

  // initialize the DMX library with the universe size
  if (!DMX.begin(universeSize)) {
    Serial.println("Failed to initialize DMX!");
    while (1); // wait for ever
  }
}

void loop() {
  // set channel 1 value to 255
  DMX.beginTransmission();
  DMX.write(1, 255);
  DMX.endTransmission();

  delay(1000);

  // set channel 1 value to 0
  DMX.beginTransmission();
  DMX.write(1, 0);
  DMX.endTransmission();

  delay(1000);
}

I've no experience with an OPTA, but this web page may be of help:
https://docs.arduino.cc/tutorials/opta/getting-started-with-rs485/
There seems to be some additional work required to calculate the preDelay and postDelay values which are used by the RS485 setDelays function call.

See if that helps.

Decrease the duration of this delay to 60 ms instead of 1000:

the ArduinoDMX library is not very efficient and if you block by a long delay there is no refresh or generation of the DMX. You have to refresh by executing the DMX.begin, DMX.write and DMX.end.

I use other DMX libraries but they are not compatible with the Opta.

@fdu01 please use English when posting in the forum's English language categories.

You are welcome to compose posts in your native language, then run it through a machine translation service (e.g., Google Translate) and post that translated text.

We do have a dedicated forum category for discussions in the French language: Français