Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Timezone NTPClient
Revision 4:fe9189193dcd, committed 2020-11-13
- Comitter:
- hudakz
- Date:
- Fri Nov 13 09:37:14 2020 +0000
- Parent:
- 3:2862fe67dce0
- Commit message:
- A remote timer, equipped with a scheduling Web interface, controls a "DigitalOut".
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 12 18:36:25 2020 +0000
+++ b/main.cpp Fri Nov 13 09:37:14 2020 +0000
@@ -20,7 +20,7 @@
#include "NTPClient.h"
#include "Timezone.h"
-#define IP "192.168.1.181"
+#define IP "192.168.1.183"
#define GATEWAY "192.168.1.1"
#define NETMASK "255.255.255.0"
#define PORT 80
@@ -325,7 +325,7 @@
"<meta name=viewport content=\"width=device-width\">\n"
"<a href=/sw>[Switch]</a> <a href=/sc>[Set clock]</a> <a href=/>[↻Refresh]</a>\n"
);
- strcat(httpBuf, "<h2><pre>Watering Timer<br>");
+ strcat(httpBuf, "<h2><pre>24h Watering Timer<br>");
strcat(httpBuf, "Output: ");
if (relay == ON) {
@@ -630,13 +630,12 @@
//net = NetworkInterface::get_default_instance();
net = new EthernetInterface();
- //net->set_network("192.168.1.181","255.255.255.0","192.168.1.1"); // use static IP address, netmask, gateway
+ net->set_network(IP,NETMASK,GATEWAY); // uncomment to use static IP address, netmask, gateway
if (!net) {
printf("Error! No network inteface found.\n");
return 0;
}
- //net->set_network (IP, NETMASK, GATEWAY); // include this to use static IP address
nsapi_size_or_error_t r = net->connect();
if (r != NSAPI_ERROR_OK) {
printf("Error! net->connect() returned: %d\n", r);