connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $cmd = ""; // add any single commands switch ($_REQUEST['command']) { case "SetColor": $cmd = "SetColor" . "," . clean_number($_REQUEST['SC_R']) . "," . clean_number($_REQUEST['SC_G']) . "," . clean_number($_REQUEST['SC_B']); break; case "ColorWipeUp": $cmd = "ColorWipeUp" . "," . clean_number($_REQUEST['CWU_R']) . "," . clean_number($_REQUEST['CWU_G']) . "," . clean_number($_REQUEST['CWU_B']) . "," . clean_number($_REQUEST['CWU_Wait']); break; case "ColorWipeDown": $cmd = "ColorWipeDown" . "," . clean_number($_REQUEST['CWD_R']) . "," . clean_number($_REQUEST['CWD_G']) . "," . clean_number($_REQUEST['CWD_B']) . "," . clean_number($_REQUEST['CWD_Wait']); break; case "Rainbow": $cmd = "Rainbow" . "," . clean_number($_REQUEST['R_Wait']); break; case "RainbowCycle": $cmd = "RainbowCycle" . "," . clean_number($_REQUEST['RC_Wait']); break; case "Chase": $cmd = "Chase" . "," . clean_number($_REQUEST['CH_Width']) . "," . clean_number($_REQUEST['CH_Gap']) . "," . clean_number($_REQUEST['CH_Wait']) . "," . clean_number($_REQUEST['CH_FR']) . "," . clean_number($_REQUEST['CH_FG']) . "," . clean_number($_REQUEST['CH_FB']) . "," . clean_number($_REQUEST['CH_BR']) . "," . clean_number($_REQUEST['CH_BG']) . "," . clean_number($_REQUEST['CH_BB']); break; case "ChaseSingleUp": $cmd = "ChaseSingleUp" . "," . clean_number($_REQUEST['CSU_Width']) . "," . clean_number($_REQUEST['CSU_Wait']) . "," . clean_number($_REQUEST['CSU_FR']) . "," . clean_number($_REQUEST['CSU_FG']) . "," . clean_number($_REQUEST['CSU_FB']) . "," . clean_number($_REQUEST['CSU_BR']) . "," . clean_number($_REQUEST['CSU_BG']) . "," . clean_number($_REQUEST['CSU_BB']); break; case "ChaseSingleDown": $cmd = "ChaseSingleDown" . "," . clean_number($_REQUEST['CSD_Width']) . "," . clean_number($_REQUEST['CSD_Wait']) . "," . clean_number($_REQUEST['CSD_FR']) . "," . clean_number($_REQUEST['CSD_FG']) . "," . clean_number($_REQUEST['CSD_FB']) . "," . clean_number($_REQUEST['CSD_BR']) . "," . clean_number($_REQUEST['CSD_BG']) . "," . clean_number($_REQUEST['CSD_BB']); break; case "Radiate": $cmd = "Radiate" . "," . clean_number($_REQUEST['RAD_Width']) . "," . clean_number($_REQUEST['RAD_Wait']) . "," . clean_number($_REQUEST['RAD_FR']) . "," . clean_number($_REQUEST['RAD_FG']) . "," . clean_number($_REQUEST['RAD_FB']) . "," . clean_number($_REQUEST['RAD_BR']) . "," . clean_number($_REQUEST['RAD_BG']) . "," . clean_number($_REQUEST['RAD_BB']); break; case "MiddleToEdge": $cmd = "MiddleToEdge" . "," . clean_number($_REQUEST['MTE_R']) . "," . clean_number($_REQUEST['MTE_G']) . "," . clean_number($_REQUEST['MTE_B']) . "," . clean_number($_REQUEST['MTE_Wait']); break; case "BarRight": $cmd = "BarRight" . "," . clean_number($_REQUEST['BARR_Width']) . "," . clean_number($_REQUEST['BARR_Wait']) . "," . clean_number($_REQUEST['BARR_FR']) . "," . clean_number($_REQUEST['BARR_FG']) . "," . clean_number($_REQUEST['BARR_FB']) . "," . clean_number($_REQUEST['BARR_BR']) . "," . clean_number($_REQUEST['BARR_BG']) . "," . clean_number($_REQUEST['BARR_BB']); break; case "BarLeft": $cmd = "BarLeft" . "," . clean_number($_REQUEST['BARL_Width']) . "," . clean_number($_REQUEST['BARL_Wait']) . "," . clean_number($_REQUEST['BARL_FR']) . "," . clean_number($_REQUEST['BARL_FG']) . "," . clean_number($_REQUEST['BARL_FB']) . "," . clean_number($_REQUEST['BARL_BR']) . "," . clean_number($_REQUEST['BARL_BG']) . "," . clean_number($_REQUEST['BARL_BB']); break; case "Mice": $cmd = "Mice" . "," . clean_number($_REQUEST['MICE_Num_Mice']) . "," . clean_number($_REQUEST['MICE_Width']) . "," . clean_number($_REQUEST['MICE_Min_Vel']) . "," . clean_number($_REQUEST['MICE_Max_Vel']) . "," . clean_number($_REQUEST['MICE_Wait']) . "," . clean_number($_REQUEST['MICE_FR']) . "," . clean_number($_REQUEST['MICE_FG']) . "," . clean_number($_REQUEST['MICE_FB']) . "," . clean_number($_REQUEST['MICE_BR']) . "," . clean_number($_REQUEST['MICE_BG']) . "," . clean_number($_REQUEST['MICE_BB']); break; case "XmasColors": $cmd = "XmasColors"; break; case "RedWhite": $cmd = "RedWhite"; break; case "FadeAB": $cmd = "FadeAB" . "," . clean_number($_REQUEST['FAB_R1']) . "," . clean_number($_REQUEST['FAB_G1']) . "," . clean_number($_REQUEST['FAB_B1']) . "," . clean_number($_REQUEST['FAB_R2']) . "," . clean_number($_REQUEST['FAB_G2']) . "," . clean_number($_REQUEST['FAB_B2']) . "," . clean_number($_REQUEST['FAB_Wait']) . "," . clean_number($_REQUEST['FAB_Steps']); break; case "Sparkle": $cmd = "Sparkle" . "," . clean_number($_REQUEST['SP_R1']) . "," . clean_number($_REQUEST['SP_G1']) . "," . clean_number($_REQUEST['SP_B1']) . "," . clean_number($_REQUEST['SP_R2']) . "," . clean_number($_REQUEST['SP_G2']) . "," . clean_number($_REQUEST['SP_B2']) . "," . clean_number($_REQUEST['SP_Wait']) . "," . clean_number($_REQUEST['SP_Steps']); break; case "Wait": $cmd = "Wait" . "," . clean_number($_REQUEST['Wait_Secs']); break; } if ($cmd <> "" ) { $query = "INSERT INTO queue (queue_command) VALUES ('{$cmd}')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); } // add any macro commands switch ($_REQUEST['command']) { case "Xmas2013": $query = "INSERT INTO queue (queue_command) VALUES ('Sparkle,255,0,0,0,255,0,20,400')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('RedWhite')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Chase,3,10,75,255,0,0,0,100,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Chase,3,10,75,0,255,0,100,0,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('XmasColors')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Wait,8')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('FadeAB,0,0,0,0,0,255,10,50')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Wait,5')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Chase,3,10,75,255,255,255,0,0,255')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); break; case "Thanksgiving2013": $query = "INSERT INTO queue (queue_command) VALUES ('SetColor,204,50,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('FadeAB,204,50,0,255,240,0,50,50')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('SetColor,255,240,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('FadeAB,255,240,0,151,69,0,50,50')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('SetColor,151,69,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('FadeAB,151,69,0,204,50,0,50,50')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); break; case "Halloween2013": $query = "INSERT INTO queue (queue_command) VALUES ('FadeAB,0,0,0,204,50,0,10,50')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('MiddleToEdge,0,100,0,10')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('MiddleToEdge,150,0,150,10')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('MiddleToEdge,204,50,0,10')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('BarRight,5,10,0,0,0,204,50,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('BarLeft,5,10,0,0,0,204,50,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); break; case "Halloween2014": $query = "INSERT INTO queue (queue_command) VALUES ('FadeAB,0,0,0,204,50,0,10,50')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Radiate,5,40,150,0,150,0,255,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Radiate,5,40,255,0,0,0,0,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Mice,10,5,2,5,40,0,0,0,204,50,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); $query = "INSERT INTO queue (queue_command) VALUES ('Radiate,5,40,255,0,0,100,0,0')"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); break; } //mysqli_free_result($result); $db->close(); } //$_REQUEST['command'] != "" if(isset($_POST['remove_id'])){ $db = new mysqli('YOUR DB SERVER', 'YOUR USER NAME', 'YOUR DB PASSWORD', 'YOUR DB'); if($db->connect_errno > 0) die('Unable to connect to database [' . $db->connect_error . ']'); if (is_array($_POST['remove_id'])) { foreach($_POST['remove_id'] as $value){ $query = "DELETE FROM queue WHERE queue_id = '{$value}'"; //echo $query . "
\n"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); } } else { $value = $_POST['remove_id']; $query = "DELETE FROM queue WHERE queue_id = '{$value}'"; //echo $query . "
\n"; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); } //mysqli_free_result($result); $db->close(); } ?>
Add Instructions
Set ColorR: G: B:
Set the whole strip to the given color.
Color Wipe UpR: G: B: Wait:
Set the strip to the given color as a wipe from left to right. Wait is the ms between each LED.
Color Wipe DownR: G: B: Wait:
Set the strip to the given color as a wipe from rigth to left. Wait is the ms between each LED.
RainbowWait:
Rainbow CycleWait:
Slightly different, this makes the rainbow equally distributed throughout.
ChaseWidth: Gap: Wait: fR: fG: fB: bR: bG: bB:
Bars with Width number of LEDs moving left to right with a Gap number of LEDs inbetween.
Fade ABR1: G1: B1: R2: G2: B2: Wait: steps:(50)
Fade from one color to the next witht he given steps and Wait ms between changes.
SparkleR1: G1: B1: R2: G2: B2: Wait:(20) steps:(400)
random blinking the two colors steps times.
Chase Single UpWidth: Wait: fR: fG: fB: bR: bG: bB:
Move a single pixel from left to right.
Chase Single DownWidth: Wait: fR: fG: fB: bR: bG: bB:
Move a single pixel from right to left.
Middle to edgeR: G: B: Wait:
Start in the middle of the strip and move the color out in both directions to the end.
RadiateWidth: Wait: fR: fG: fB: bR: bG: bB:
Expanding bars from the middle - try 5/40 for width/wait.
Bar RightWidth: Wait: fR: fG: fB: bR: bG: bB:
Move a bar of Width size in the front color from left to right.
Bar LeftWidth: Wait: fR: fG: fB: bR: bG: bB:
Move a bar of Width size in the front color from right to left.
Mice# Mice: Width: Min Velocity: Max Velocity: Wait: fR: fG: fB: bR: bG: bB:
Move a single pixel from left to right.
Xmas ColorsA fixed set of classic Xmas colors like the old bulbs.
Red/WhiteA red and white animation.
WaitWait Seconds:
Pause for the given number of seconds.
Xmas 2013 Macro
Thanksgiving 2013 Macro
Halloween 2013 Macro
Halloween 2014 Macro

Running Instructions
connect_errno > 0) die('Unable to connect to database [' . $db->connect_error . ']'); $query = 'SELECT * FROM queue ORDER BY queue_id ASC'; if (!$result = $db->query($query)) die('There was an error running the query [' . $db->error . ']'); while ($line = $result->fetch_array(MYSQLI_ASSOC)) { echo " {$line['queue_command']}
\n"; } //mysqli_free_result($result); $db->close(); ?>