I have made a web based light controller, and everything is working perfectly. But i have a problem turning off one of the fixtures.
For turning OFF the lamp, a value of 250 has to be send on channel 17 for at least 5 sec. And this is where it gets tricky, how do I do that?
I am using the DMXSerial library from http://www.mathertel.de/Arduino/DMXSerial.aspx, but it lacks documentation.
Here is a small piece off the code.
if(finder.find("#dmx")) { // Find out if this is a dmx string.
if(finder.findUntil("type", ",")) { // Finds the type
cmd = finder.getValue(); // Putting the value found in its variable.
if(cmd == 4) {
if(finder.findUntil("ch", ",")) {
channel = finder.getValue();
}
if(finder.findUntil("va", ",\n\r")) {
val = finder.getValue();
}
if(channel == 17 && val == 250) {
// some code here
} else {
DMXSerial.write(channel, val);
}
}
}
Any help will be welcome.