Skip to content

V2 overhaul - #12

Merged
sfe-SparkFro merged 5 commits into
masterfrom
v2_overhaul
Oct 12, 2023
Merged

sfe-SparkFro merged 5 commits into
masterfrom
v2_overhaul

Conversation

@sfe-SparkFro

@sfe-SparkFro sfe-SparkFro commented Oct 3, 2023 •

Copy link
Copy Markdown
Contributor

Rewrite of entire library:

  • Should work with any platform (only tested with SparkFun ESP32 Thing Plus boards so far)
  • Now uses interrupts instead of timer for break signal detection
    • Break signals are detected by looking at received data. The break signal should be read as a zero, followed by a zero for channel 0. If that's not detected, the buffer is flushed to hopefully sync on the next iteration. It's not necessarily guaranteed to work perfectly, but it seems to work well in testing, and it provides a solution that should work on any platform (interrupts don't always trigger properly on pins used for UART)
  • DMX serial port is no longer restarted over and over
  • Serial port must be started before calling begin() of this library, which should help with platform compatibility
  • First examples are simplified

Bump version number
Rewrite entire library
Now uses interrupts instead of timer for break signal detection
DMX serial port is no longer restarted over and over
Should work with any platform (only tested with SparkFun ESP32 Thing Plus boards so far)
Much more simplified, does not require any external components like servos and LEDs
Uses updated DMX library
Using an interrupt on the UART RX pin may not work on all platforms (it actually doesn't work with ESP32 Arduino core v3.0.0 Alpha 1).
This does away with the interrupt synchronization, and instead just looks at the received data in the UART buffer. A break signal just looks like an extra 0 byte.
There is a risk of improper synchronization, but the bytes are checked for zeros and the buffer is flushed if it looks wrong. Testing has shown it to work well.
This also removes the requirement for the DMX class to know the TX and RX pins, another simplification
Also moved _dmxBuffer.begin() outside of begin(), caller is required to begin the serial port with the proper settings. This makes it easier to ensure pins and such are set properly on any platform
Update to use new DMX library syntax
Also fix capitalization of WiFiUDP
@sfe-SparkFro

Copy link
Copy Markdown
Contributor Author

Fixes #10
Fixes #9
Fixes #8
Fixes #7
Fixes #5 (hopefully?)
Fixes #4 (hopefully?)
Fixes #3 (hopefully?)

@sfe-SparkFro
sfe-SparkFro merged commit 17d517c into master Oct 12, 2023
@sfe-SparkFro
sfe-SparkFro deleted the v2_overhaul branch October 12, 2023 19:21
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

Successfully merging this pull request may close these issues.

1 participant