GithubHelp home page GithubHelp logo

dmx timing about esp_dmx HOT 1 CLOSED

DeverosTV avatar DeverosTV commented on June 16, 2024
dmx timing

from esp_dmx.

Comments (1)

someweisguy avatar someweisguy commented on June 16, 2024

Absolutely - there are two pairs of getters/setters that is used for updating the DMX timing in this library: dmx_set_break_len() and dmx_set_mab_len(). There are getters for these functions as well. Just replace the _set_ with _get_. The setters will set the break or MAB length to a specified value in microseconds. The getters will return a value in microseconds.

The DMX break length can be set to any value between 92 micros (DMX_BREAK_LEN_MIN_US) and 1,000,000 micros (DMX_BREAK_LEN_MAX_US). The default break length is 176 micros (DMX_BREAK_LEN_US). The DMX MAB length can be set to any value between 12 micros (DMX_MAB_LEN_MIN_US) and 999,999 micros (DMX_MAB_LEN_MAX_US). The default MAB length is 12 micros (DMX_MAB_LEN_US).

If you're using RDM, there are RDM-specific constants that should be used instead, e.g. RDM_BREAK_LEN_MAX_US or RDM_MAB_LEN_MAX_US.

You can also update the DMX framerate. I suspect this is what needs to be done to fix the issue with your hazer. There isn't a function used to update the framerate. You would need to update the framerate in your own code. To do this, you would have to add a delay to your code before calling dmx_send(). An easy way to accomplish this would be to add a call to delay() if you're using Arduino or vTaskDelay() if you're using ESP-IDF.

Here's a somewhat naive example DMX loop with the delay for Arduino:

void loop() {
  dmx_write(dmxPort, data, DMX_PACKET_SIZE);
  dmx_send(dmxPort, DMX_PACKET_SIZE);

  dmx_wait_sent(dmxPort, DMX_TIMEOUT_TICK);

  delay(20);  // Wait 20ms before sending the next packet
}

Hopefully this is helpful! Let me know if you have any other questions!

from esp_dmx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.