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

how to define START_CHANNEL during runtime? #40

Open
stephanschulz opened this issue Feb 6, 2023 · 2 comments
Open

how to define START_CHANNEL during runtime? #40

stephanschulz opened this issue Feb 6, 2023 · 2 comments

Comments

@stephanschulz
Copy link

stephanschulz commented Feb 6, 2023

Thank you for making this library.

I am starting the process of converting some of my Teensy code to work on a PICO.
My project reads a dip switch to determine the DMX start channel.

In you example you define volatile uint8_t buffer[DMXINPUT_BUFFER_SIZE(START_CHANNEL, NUM_CHANNELS)]; befor the code starts.
Is there a way to either change the buffer or set the buffer during void setup() ?

I guess more specifically i wonder if i can call dmxInput.begin(0, START_CHANNEL, NUM_CHANNELS); again after a dip switch change was noticed? Do i need to call dmxInput.end() first?

Thank you for your advice.

@jostlowe
Copy link
Owner

jostlowe commented Mar 9, 2023

Hi, and sorry for the late reply!

Yes, you can re-initialize a DMX input, but as you said, you need to call dmxInput.end() before calling dmxInput.begin(...) again

@michaelglass
Copy link

michaelglass commented Feb 14, 2024

the other approach is reading the whole universe (all 512 channels) and dynamically deciding which channels to use. (from #15 (comment)). If your DMX device is sending a partial universe (which my fader does) then this is, afaict, the only way of changing start channel with this library.

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

3 participants