Skip to content

Instantly share code, notes, and snippets.

@neufuture
Created September 14, 2012 16:53
Show Gist options
  • Save neufuture/3723209 to your computer and use it in GitHub Desktop.
Save neufuture/3723209 to your computer and use it in GitHub Desktop.
chauvet dmx translator
float panMax = 540;
float tiltMax = 270;
void setRotate(int channel, float deg, float axisMax) {
float val = deg*255.0;
int coarse = floor(val);
int fine = round((val-coarse)*axisMax/fineMax);
dmxMsg(channel, coarse);
dmxMsg(channel+2, fine);
}
void dmxMsg(int channel, int value){
// send message here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment