Skip to content

random glitches on DMX received data #138

@antoniomechas

Description

@antoniomechas

Hello,
I'm using the library as a DMX receiver from an ENTTEC USB PRO.
It kind of works, but I get random values time to time, even when the values I'm sending stay stable without modification.

The relevant code I'm using:

void setup() 
{

  WiFiOff();

  dmxA.begin();
  dmxA.dmxIn(true);

  dmxA.setInputCallback(dmxIn);

  delay(1000);
  
} // setup

void dmxIn(uint16_t num) {
    // Double buffer switch
    //byte* tmp = dataIn;
    dataIn = dmxA.getChans();
    //dmxA.setBuffer(tmp);

    newDmxIn = true;
}

void loop() {

    //dmxA.handler();
    if (newDmxIn)
    {
  	  analogWrite(PIN_LASER, dataIn[1]);
  	  newDmxIn = false;
  	  lastDMX = millis();
  	  singleGreen();
    }

    if (millis() - lastDMX > 2000)
  	  singleRed();

    delay(1);

} // loop

I get the laser glitching even when the value of the channel stays to 255.

If I put all the channels at the same value, it seems to get a bit more stable.

Any thoughts what could I test?

Thanks!
Antonio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions