forked from Aircoookie/WLED
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Aircoookie/WLED into Airc…
…oookie-master
- Loading branch information
Showing
45 changed files
with
2,356 additions
and
1,876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
/platformio_override.ini | ||
.DS_Store | ||
.gitignore | ||
.clang-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include "wled.h" | ||
|
||
/* | ||
* Support for DMX via MAX485. | ||
* Change the output pin in src/dependencies/ESPDMX.cpp if needed. | ||
* Library from: | ||
* https://github.com/Rickgg/ESP-Dmx | ||
*/ | ||
|
||
#ifdef WLED_ENABLE_DMX | ||
#include "src/dependencies/dmx/ESPDMX.h" | ||
DMXESPSerial dmx; | ||
|
||
void handleDMX() | ||
{ | ||
// TODO: calculate brightness manually if no shutter channel is set | ||
|
||
uint8_t brightness = strip.getBrightness(); | ||
|
||
for (int i = 0; i < ledCount; i++) { // uses the amount of LEDs as fixture count | ||
|
||
uint32_t in = strip.getPixelColor(i); // get the colors for the individual fixtures as suggested by Aircoookie in issue #462 | ||
byte w = in >> 24 & 0xFF; | ||
byte r = in >> 16 & 0xFF; | ||
byte g = in >> 8 & 0xFF; | ||
byte b = in & 0xFF; | ||
|
||
int DMXFixtureStart = DMXStart + (DMXGap * i); | ||
for (int j = 0; j < DMXChannels; j++) { | ||
int DMXAddr = DMXFixtureStart + j; | ||
switch (DMXFixtureMap[j]) { | ||
case 0: // Set this channel to 0. Good way to tell strobe- and fade-functions to fuck right off. | ||
dmx.write(DMXAddr, 0); | ||
break; | ||
case 1: // Red | ||
dmx.write(DMXAddr, r); | ||
break; | ||
case 2: // Green | ||
dmx.write(DMXAddr, g); | ||
break; | ||
case 3: // Blue | ||
dmx.write(DMXAddr, b); | ||
break; | ||
case 4: // White | ||
dmx.write(DMXAddr, w); | ||
break; | ||
case 5: // Shutter channel. Controls the brightness. | ||
dmx.write(DMXAddr, brightness); | ||
break; | ||
case 6: // Sets this channel to 255. Like 0, but more wholesome. | ||
dmx.write(DMXAddr, 255); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
dmx.update(); // update the DMX bus | ||
} | ||
|
||
#else | ||
void handleDMX() {} | ||
#endif |
Oops, something went wrong.