Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random glitches on DMX received data #138

Open
antoniomechas opened this issue Nov 21, 2021 · 1 comment
Open

random glitches on DMX received data #138

antoniomechas opened this issue Nov 21, 2021 · 1 comment

Comments

@antoniomechas
Copy link

antoniomechas commented Nov 21, 2021

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.

@antoniomechas
Copy link
Author

Digging a little bit more... it happens with the Lolin Wemos D1 pro... if I use a wemos D1 mini, the glitches dissapear.
I have no clue why it happens.
Antonio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant