A remote timer, equipped with a scheduling Web interface, controls a "DigitalOut".

Dependencies:   Timezone NTPClient

WebTimer

The WebTimer is an Mbed device enabling to remotely control a DigitalOut. It has a "calendar-like" user interface to edit the schedule - a table you can click on (or tap on a touch-screen device).
The program was ported to Mbed from the Tuxgraphics site. Thank you Guido for sharing!

  • When starting, it will print it's IP address over the USB serial link to the terminal screen. However, you can set a different static IP address if you modify the code in the main.cpp.
  • To connect to the WebTimer, type the IP address into the web browser edit box and hit ENTER.
  • When a cell is green then the timer keeps it's output ON during that period of time. If a cell is not green it means the output is OFF.
  • To select or deselect multiple cells you can click (keep down the button) and move the mouse over more cells.
  • The smallest time interval on this 24h timer is 15minutes.
  • To save the changes type in the password and hit ENTER or click on the Save button.
  • The default password is "secret". But you can change it by editing the source code in main.cpp.
OnDesktopOnPhone
Revision:
2:6d02d3d314a2
Parent:
1:2d2517f82319
Child:
3:2862fe67dce0
--- a/main.cpp	Wed Nov 11 17:09:39 2020 +0000
+++ b/main.cpp	Thu Nov 12 18:23:29 2020 +0000
@@ -112,12 +112,16 @@
     strcat(httpBuf, &strBuf[i]);
 }
 
-/* check the tablebitmap and return:
- * 0 there is no change compared to previous minute and current state is off
- * 1 the on/off state changed from on to off
- * 2 the on/off state changed from off to on
- * 3 there is no change compared to previous minute and current state is on
+/**
+ * @brief   Check the tablebitmap
+ * @note
+ * @param
+ * @retval  0 there is no change compared to previous minute and current state is off
+ *          1 the on/off state changed from on to off
+ *          2 the on/off state changed from off to on
+ *          3 there is no change compared to previous minute and current state is on
  */
+
 uint8_t checkTableBitmap(uint8_t h, uint8_t m)
 {
     uint8_t tablepage, bitpos;
@@ -255,7 +259,9 @@
 
 /**
  * @brief
- * @note
+ * @note    In the function fill we encode all the 96 fiels into 6 numbers
+ *          with 16 bit. Every bit represents a table box. If the box was
+ *          green then the bit is 1 otherwise zero.
  * @param
  * @retval
  */
@@ -264,9 +270,6 @@
     setHeaderToHttp200ok();
 
     //
-    // In the function fill we encode all the 96 fiels into 6 numbers
-    // with 16 bit. Every bit represents a table box. If the box was
-    // green then the bit is 1 otherwise zero.
     /*$off*/
     memset(httpBuf, 0, sizeof(httpBuf));
     strcpy
@@ -313,7 +316,7 @@
 }
 
 /**
- * @brief   // this is the top level main web page
+ * @brief   This is the top level main web page
  * @note
  * @param
  * @retval
@@ -344,14 +347,6 @@
     addHttpDataUint8(tmNow.tm_hour);
     strcat(httpBuf, ":");
     addHttpDataUint8(tmNow.tm_min);
-
-    //    strcat(httpBuf, "  ");
-    //    strcat(httpBuf, "Date:");
-    //    addHttpDataUint16(tmNow.tm_year + 1900);
-    //    strcat(httpBuf, "-");
-    //    addHttpDataUint8(tmNow.tm_mon + 1);
-    //    strcat(httpBuf, "-");
-    //    addHttpDataUint8(tmNow.tm_mday);
     strcat(httpBuf, "</pre></h2>\n");
     /*$off*/
     strcat
@@ -377,7 +372,7 @@
             "wr(t,i);\n"
         "}\n"
         "dw(\"</table></td></tr></table>\");\n"
-        "dw(\"1 row=15min\");\n"
+        "dw(\"1 cell=15min\");\n"
     );
     /*$on*/
     // initialize the table with the current settings