1717AsyncWebServer server (80 );
1818
1919#ifdef AP_MODE
20- const char * ssid = " PICO2" ;
21- const char * password = " 12345678" ;
20+ const char * ssid = " PICO2" ;
21+ const char * password = " 12345678" ;
2222#else
23- const char * ssid = " 使用しているルータのSSID" ;
24- const char * password = " ルータのパスワード" ;
23+ const char * ssid = " 使用しているルータのSSID" ;
24+ const char * password = " ルータのパスワード" ;
2525#endif
2626
27-
28-
29- void webServerSetup (void ) {
30-
27+ void webServerSetup (void )
28+ {
3129#ifdef AP_MODE
3230 WiFi.softAP (ssid, password);
3331 IPAddress myIP = WiFi.softAPIP ();
@@ -43,7 +41,7 @@ void webServerSetup(void) {
4341 Serial.println (WiFi.localIP ());
4442#endif
4543
46- server.on (" /" , HTTP_GET, [](AsyncWebServerRequest* request) {
44+ server.on (" /" , HTTP_GET, [](AsyncWebServerRequest * request) {
4745 String html = " " ;
4846 html += " <!DOCTYPE html>" ;
4947 html += " <html lang=\" en\" >" ;
@@ -108,12 +106,14 @@ void webServerSetup(void) {
108106 html += " ></th><th><input name=\" ref_right\" type=\" text\" size=\" 10\" value=" ;
109107 html += String (g_sensor.sen_r .ref );
110108 html += " ></th></tr>" ;
111- html += " <tr><th>SIDE Threshold</th><td><input name=\" th_left\" type=\" text\" size=\" 10\" value=" ;
109+ html +=
110+ " <tr><th>SIDE Threshold</th><td><input name=\" th_left\" type=\" text\" size=\" 10\" value=" ;
112111 html += String (g_sensor.sen_l .th_wall );
113112 html += " ></td><td><input name=\" th_right\" type=\" text\" size=\" 10\" value=" ;
114113 html += String (g_sensor.sen_r .th_wall );
115114 html += " ></td></tr>" ;
116- html += " <tr><th>FRONT Threshold</th><th><input name=\" th_fl\" type=\" text\" size=\" 10\" value=" ;
115+ html +=
116+ " <tr><th>FRONT Threshold</th><th><input name=\" th_fl\" type=\" text\" size=\" 10\" value=" ;
117117 html += String (g_sensor.sen_fl .th_wall );
118118 html += " ></th><th><input name=\" th_fr\" type=\" text\" size=\" 10\" value=" ;
119119 html += String (g_sensor.sen_fr .th_wall );
@@ -130,10 +130,12 @@ void webServerSetup(void) {
130130
131131 html += " <p><h2>Tire Parameter</h2></p>" ;
132132 html += " <table align=\" center\" >" ;
133- html += " <tr><th>TIRE_DIAMETER</th><td><input name=\" tire_dia\" type=\" text\" size=\" 10\" value=" ;
133+ html +=
134+ " <tr><th>TIRE_DIAMETER</th><td><input name=\" tire_dia\" type=\" text\" size=\" 10\" value=" ;
134135 html += String (g_run.tire_diameter , 3 );
135136 html += " >mm</td></tr>" ;
136- html += " <tr><th>TREAD_WIDTH</th><td><input name=\" tread_width\" type=\" text\" size=\" 10\" value=" ;
137+ html +=
138+ " <tr><th>TREAD_WIDTH</th><td><input name=\" tread_width\" type=\" text\" size=\" 10\" value=" ;
137139 html += String (g_run.tread_width , 3 );
138140 html += " >mm</td></tr>" ;
139141 html += " </table>" ;
@@ -154,7 +156,8 @@ void webServerSetup(void) {
154156
155157 html += " <p><h2>Accel Parameter</h2></p>" ;
156158 html += " <table align=\" center\" >" ;
157- html += " <tr><th>Search accel</th><td><input name=\" search_acc\" type=\" text\" size=\" 10\" value=" ;
159+ html +=
160+ " <tr><th>Search accel</th><td><input name=\" search_acc\" type=\" text\" size=\" 10\" value=" ;
158161 html += String (g_run.search_accel , 3 );
159162 html += " >mm</td></tr>" ;
160163 html += " <tr><th>Turn accel</th><td><input name=\" turn_acc\" type=\" text\" size=\" 10\" value=" ;
@@ -166,7 +169,8 @@ void webServerSetup(void) {
166169
167170 html += " <p><h2>Speed Parameter</h2></p>" ;
168171 html += " <table align=\" center\" >" ;
169- html += " <tr><th>Search speed</th><td><input name=\" search_spd\" type=\" text\" size=\" 10\" value=" ;
172+ html +=
173+ " <tr><th>Search speed</th><td><input name=\" search_spd\" type=\" text\" size=\" 10\" value=" ;
170174 html += String (g_run.search_speed );
171175 html += " >mm</td></tr>" ;
172176 html += " <tr><th>max speed</th><td><input name=\" max_spd\" type=\" text\" size=\" 10\" value=" ;
@@ -176,7 +180,6 @@ void webServerSetup(void) {
176180 html += " <br>" ;
177181 html += " <br>" ;
178182
179-
180183 html += " <input type=\" submit\" value=\" Save\" >" ;
181184 html += " </form><br>" ;
182185 html += " </body>" ;
@@ -247,28 +250,27 @@ void webServerSetup(void) {
247250 request->send (200 , " text/html" , html);
248251 });
249252
250- server.on (" /voltage" , HTTP_GET, [](AsyncWebServerRequest* request) {
253+ server.on (" /voltage" , HTTP_GET, [](AsyncWebServerRequest * request) {
251254 request->send (200 , " text/plain" , String (g_sensor.battery_value ) + " mV" );
252255 });
253256
254- server.on (" /left_value" , HTTP_GET, [](AsyncWebServerRequest* request) {
257+ server.on (" /left_value" , HTTP_GET, [](AsyncWebServerRequest * request) {
255258 request->send (200 , " text/plain" , String (g_sensor.sen_l .value ));
256259 });
257260
258- server.on (" /right_value" , HTTP_GET, [](AsyncWebServerRequest* request) {
261+ server.on (" /right_value" , HTTP_GET, [](AsyncWebServerRequest * request) {
259262 request->send (200 , " text/plain" , String (g_sensor.sen_r .value ));
260263 });
261264
262- server.on (" /left_front_value" , HTTP_GET, [](AsyncWebServerRequest* request) {
265+ server.on (" /left_front_value" , HTTP_GET, [](AsyncWebServerRequest * request) {
263266 request->send (200 , " text/plain" , String (g_sensor.sen_fl .value ));
264267 });
265268
266- server.on (" /right_front_value" , HTTP_GET, [](AsyncWebServerRequest* request) {
269+ server.on (" /right_front_value" , HTTP_GET, [](AsyncWebServerRequest * request) {
267270 request->send (200 , " text/plain" , String (g_sensor.sen_fr .value ));
268271 });
269272
270-
271- server.on (" /get" , HTTP_GET, [](AsyncWebServerRequest* request) {
273+ server.on (" /get" , HTTP_GET, [](AsyncWebServerRequest * request) {
272274 String inputMessage;
273275
274276 inputMessage = request->getParam (" tire_dia" )->value ();
@@ -309,10 +311,9 @@ void webServerSetup(void) {
309311 inputMessage = request->getParam (" max_spd" )->value ();
310312 g_run.max_speed = inputMessage.toInt ();
311313
312-
313314 Serial.println (" saved" );
314315 paramWrite ();
315- g_run.pulse = g_run.tire_diameter * PI / (35.0 / 10.0 * 20.0 *8.0 );
316+ g_run.pulse = g_run.tire_diameter * PI / (35.0 / 10.0 * 20.0 * 8.0 );
316317
317318 buzzerEnable (INC_FREQ);
318319 delay (30 );
0 commit comments