ボタンを押すと、 バッテリ更新を停止し、 他のボタンもロックさせる

Dependencies:   RemoteIR TextLCD

Revision:
38:39db3f7450c2
Parent:
37:0cde453dce7d
Child:
39:054c17d10c55
--- a/main.cpp	Tue Aug 18 01:43:15 2020 +0000
+++ b/main.cpp	Tue Aug 18 08:13:07 2020 +0000
@@ -692,7 +692,7 @@
     strcpy(webbuff, "<!DOCTYPE html>");
     strcat(webbuff, "<html><head><title>RobotCar</title><meta name='viewport' content='width=device-width'/>");
     strcat(webbuff, "<meta http-equiv=\"refresh\" content=\"5\"; >");
-    strcat(webbuff, "<style type=\"text/css\">.noselect{ width:100px;height:60px;}.light{ width:100px;height:60px;background-color:#00ff66;}</style>");
+    strcat(webbuff, "<style type=\"text/css\">.noselect{ width:100px;height:60px;}.light{ width:100px;height:60px;background-color:#00ff66;}.load{ width: 50px; height: 30px;font-size:10px}</style>");
     strcat(webbuff, "</head><body><center><p><strong>Robot Car Remote Controller");
     strcat(webbuff, "</strong></p><td style='vertical-align:top;'><strong>Battery level ");
     if(b > 30) {    //残電量表示
@@ -703,6 +703,7 @@
         strcat(webbuff, "<\font>");
     }
     strcat(webbuff, "%</strong>");
+    strcat(webbuff, "<button id=\"reloadbtn\" type=\"button\" class=\"load\" onclick=\"rel()\">RELOAD</button>");
     strcat(webbuff, "</td></p>");
     strcat(webbuff, "<br>");
     strcat(webbuff, "<table><tr><td></td><td>");
@@ -878,6 +879,10 @@
     strcat(webbuff, "</html>");
     strcat(webbuff, "<script language=\"javascript\" type=\"text/javascript\">");       //機能
     
+    strcat(webbuff, "function rel(){");
+    strcat(webbuff, "location.reload();");
+    strcat(webbuff, "}");
+    
     strcat(webbuff, "function htmlacs(url) {");
     strcat(webbuff, "var xhr = new XMLHttpRequest();");
     strcat(webbuff, "xhr.open(\"GET\", url);");