Created
September 14, 2012 16:53
-
-
Save neufuture/3723209 to your computer and use it in GitHub Desktop.
chauvet dmx translator
This file contains hidden or 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
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