@@ -84,23 +84,27 @@ void setup()
8484 }
8585 gfx->fillScreen (RGB565_BLACK);
8686 gfx->setUTF8Print (true ); // enable UTF8 support for the Arduino print() function
87- gfx->setFont (u8g2_font_unifont_h_cjk );
87+ gfx->setFont (u8g2_font_cubic11_h_cjk );
8888
8989 w = gfx->width ();
9090 h = gfx->height ();
91- banner_text_size = (w < 368 ) ? 1 : 2 ;
92- banner_height = banner_text_size * 16 ;
93- graph_height = h - banner_height - (3 * 16 ); // minus 3 text lines
94- graph_baseline = banner_height + 16 + graph_height;
91+ banner_text_size = (w < 256 ) ? 1 : 2 ;
92+ banner_height = banner_text_size * 15 ;
93+ graph_height = h - banner_height - (3 * 15 ); // minus 3 text lines
94+ graph_baseline = banner_height + 15 + graph_height;
9595 channel_width = w / 16 ;
9696 signal_width = channel_width * 2 ;
9797
9898 // init banner
99- gfx->fillRect (0 , 0 , w, banner_text_size * 16 , RGB565_PURPLE);
99+ gfx->fillRect (0 , 0 , w, banner_text_size * 15 , RGB565_PURPLE);
100100 gfx->setTextSize (banner_text_size);
101- gfx->setCursor (0 , banner_text_size * 14 );
101+ gfx->setCursor (0 , ( banner_text_size * 12 ) - 1 );
102102 gfx->setTextColor (RGB565_WHITE, RGB565_CRIMSON);
103- gfx->print (" Pico W " );
103+ gfx->print (" Pi" );
104+ gfx->setTextColor (RGB565_WHITE, RGB565_DARKORANGE);
105+ gfx->print (" co" );
106+ gfx->setTextColor (RGB565_WHITE, RGB565_LIMEGREEN);
107+ gfx->print (" W " );
104108 gfx->setTextColor (RGB565_WHITE, RGB565_MEDIUMBLUE);
105109 gfx->print (" WiFi " );
106110 gfx->setTextColor (RGB565_WHITE, RGB565_PURPLE);
@@ -157,7 +161,7 @@ void loop()
157161 if (n == 0 )
158162 {
159163 gfx->setTextColor (RGB565_WHITE);
160- gfx->setCursor (0 , banner_height + 14 );
164+ gfx->setCursor (0 , banner_height + 12 );
161165 gfx->println (" 找不到WiFi" );
162166 }
163167 else
@@ -269,7 +273,7 @@ void loop()
269273 sprintf (mac, " %02X:%02X:%02X:%02X:%02X:%02X" , bssidA[0 ], bssidA[1 ], bssidA[2 ], bssidA[3 ], bssidA[4 ], bssidA[5 ]);
270274 ssid = String (mac);
271275 }
272- text_width = (ssid.length () + 6 ) * 8 ;
276+ text_width = (ssid.length () + 6 ) * 6 ;
273277 if (text_width > w)
274278 {
275279 offset = 0 ;
@@ -283,7 +287,7 @@ void loop()
283287 }
284288 }
285289 gfx->setTextColor (color);
286- gfx->setCursor (offset, ((height + 16 ) > graph_height) ? (graph_baseline - graph_height + 14 ) : (graph_baseline - height - 2 ));
290+ gfx->setCursor (offset, ((height + 15 ) > graph_height) ? (graph_baseline - graph_height + 12 ) : (graph_baseline - height - 3 ));
287291 gfx->print (ssid);
288292 gfx->print (' (' );
289293 gfx->print (rssi);
@@ -298,7 +302,7 @@ void loop()
298302
299303 // print WiFi stat
300304 gfx->setTextColor (RGB565_WHITE);
301- gfx->setCursor (0 , banner_height + 14 );
305+ gfx->setCursor (0 , banner_height + 12 );
302306 gfx->print (" 找到" );
303307 gfx->print (n);
304308 gfx->print (" 個WiFi,訊噪比較好:" );
@@ -307,7 +311,7 @@ void loop()
307311 for (channel = 2 ; channel <= 11 ; channel++) // channels 12-14 may not available
308312 {
309313 idx = channel - 1 ;
310- log_i (" min_noise: %d, noise_list[%d]: %d" , min_noise, idx, noise_list[idx]);
314+ // log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
311315 if (noise_list[idx] < min_noise)
312316 {
313317 min_noise = noise_list[idx];
@@ -341,13 +345,13 @@ void loop()
341345 if (channel > 0 )
342346 {
343347 gfx->setTextColor (channel_color[idx]);
344- gfx->setCursor (offset - ((channel < 10 ) ? 4 : 8 ), graph_baseline + 14 );
348+ gfx->setCursor (offset - ((channel < 10 ) ? 3 : 6 ), graph_baseline + 12 );
345349 gfx->print (channel);
346350 }
347351 if (ap_count_list[idx] > 0 )
348352 {
349353 gfx->setTextColor (RGB565_LIGHTGREY);
350- gfx->setCursor (offset - ((ap_count_list[idx] < 10 ) ? 4 : 8 ), graph_baseline + 16 + 14 );
354+ gfx->setCursor (offset - ((ap_count_list[idx] < 10 ) ? 3 : 6 ), graph_baseline + 15 + 12 );
351355 gfx->print (ap_count_list[idx]);
352356 }
353357 }
0 commit comments