Sebastian Schocke / Mbed 2 deprecated WiFiLamp

Dependencies:   mbed ESP8266_WebServer

Files at this revision

API Documentation at this revision

Comitter:
sschocke
Date:
Thu Jan 08 18:25:16 2015 +0000
Parent:
27:88093aa94e24
Commit message:
Disco Mode

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 88093aa94e24 -r ba5c68a04f56 main.cpp
--- a/main.cpp	Thu Jan 08 11:03:11 2015 +0000
+++ b/main.cpp	Thu Jan 08 18:25:16 2015 +0000
@@ -56,9 +56,9 @@
 {
     for ( int c = 0; c < LED_COUNT; c++ )
     {
-        colors[c].red = rand()%255;
-        colors[c].green = rand()%255;
-        colors[c].blue = rand()%255;
+        colors[c].red = rand()%100;
+        colors[c].green = rand()%100;
+        colors[c].blue = rand()%100;
     }
     
     ledStrip.write(colors, LED_COUNT);
@@ -157,7 +157,10 @@
                 httpReply += "<tr><td align='center'>";
                 httpReply += "<img style='margin-right:2px' src='colormap.gif' usemap='#colormap' />";
                 httpReply += "<map id='colormap' name='colormap'>";
-                httpReply += "</map></td></tr><tr><td><span onClick=\"changeColor('#000000')\">Turn Off</span></td></tr></table>";
+                httpReply += "</map></td></tr>";
+                httpReply += "<tr><td><span onClick=\"window.location='/disco'\">Disco Mode</span></td></tr>";
+                httpReply += "<tr><td><span onClick=\"changeColor('#000000')\">Turn Off</span></td></tr>";
+                httpReply += "</table>";
                 httpReply += htmlTail;
                 server.SendReply(request->LinkID, httpReply, mimeHTML);
             } else if( request->URI == "/config" ) {