Skip to content

Instantly share code, notes, and snippets.

@daveol
Created September 24, 2020 18:21
Show Gist options
  • Save daveol/680c1c3fe161bdc23b44fa3a9ef72f30 to your computer and use it in GitHub Desktop.
Save daveol/680c1c3fe161bdc23b44fa3a9ef72f30 to your computer and use it in GitHub Desktop.
.#include <DMXSerial.h>
void setup() {
DMXSerial.init(DMXController);
}
unsigned int n = 0;
// loop through the rainbow colors
void loop() {
for(int channel = 0; channel < 512; channel++){
int val = (abs(cos( ((16 - 2 * n) + channel) / 20 )) * 255);
DMXSerial.write(channel, val);
}
n++;
delayMicroseconds(2000); // wait a little bit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment