Comments (6)
In summary, this is what my main loop consists of:
If you receive DMX:
read it.
else if you receive artnet wifi:
read it.
perform other actions such as running stepper motors
thank you for your attention
from esp_dmx.
Yes, this is possible. The macro DMX_PACKET_TIMEOUT_TICK
specifies how long to block code execution. If I recall correctly, it is 1.25 seconds.
If you replace the macro with zero (in other words, write xQueueReceive(queue, &packet, 0)
the program will not block.
from esp_dmx.
OK perfect, thank you.
So if I understand correctly, it is better to set this value to Zero rather than not doing this check. And I will still be able to receive DMX correctly?
from esp_dmx.
In most cases, using xQueueReceive()
is preferred.
As long as the mode is set to DMX_MODE_READ
you will be able to receive data. Using xQueueReceive()
allows you to get notified when a new packet has been received. This may be easier to explain with some example code:
// Example Code 1
uint8_t data[513] = {};
while (true) {
if (xQueueReceive(queue, &packet, 0)) {
dmx_read_packet(dmx_num, data, sizeof(data));
// Process data...
// Perhaps it takes a long time to process data!
}
}
In this example, I process data every time I receive a new DMX packet. It takes a long time to process data, so I only want to process data when I receive a new packet.
And here's a different example, example 2:
// Example Code 2
uint8_t data[513] = {};
while (true) {
dmx_read_packet(dmx_num, data, sizeof(data));
// Process data...
}
In this example, I read data in every loop. This is acceptable too! The difference here is that I'm processing data even if I haven't received a new packet. This can be considered inefficient to some.
Hopefully this helps! Let me know if you have more questions! :)
from esp_dmx.
Thank you very much for this very precise and detailed answer, it is a pleasure to deal with people like you.
from esp_dmx.
Glad I could help! I'll close this for now. Feel free to reopen or open a new issue if you have any more questions!
from esp_dmx.
Related Issues (20)
- dmx timing HOT 1
- Compile errors version 2 and up HOT 8
- Troubles with ETC Express HOT 6
- RDM discovery controller HOT 12
- Error on Sample DMX Sniffer HOT 1
- DMX read example - 'isr_handle' undeclared in arduino 2.14 HOT 1
- DMX Output randomly stops for a few seconds HOT 1
- Interrupt conflict HOT 1
- rdm_register_dmx_personality missing in 3.1.0 HOT 4
- DMX Read - Unstable packet.size depends on the number of DMX channels HOT 3
- compiling error with 3.10 but not with 3.0.3-beta HOT 3
- Bug string constant to 'char*' [-Wwrite-strings] HOT 2
- Send SET RDM_PID_IDENTIFY_DEVICE argument error
- RDM controller requests are not copying parameter data HOT 2
- dmx_get_personality_description() does not work HOT 1
- ESP32-S3 RDM issues with UART0 HOT 5
- Start Address Not Saving Via RDM HOT 8
- Compile Warning
- Problem with installing DMX on UART2 HOT 5
- ESP32-C6 incompatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp_dmx.