Skip to content

Commit 1b690ee

Browse files
fine tune
1 parent 541267d commit 1b690ee

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

examples/WiFiAnalyzer/ESPWiFiAnalyzer/ESPWiFiAnalyzer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void loop()
336336
for (channel = 2; channel <= 11; channel++) // channels 12-14 may not available
337337
{
338338
idx = channel - 1;
339-
log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
339+
// log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
340340
if (noise_list[idx] < min_noise)
341341
{
342342
min_noise = noise_list[idx];

examples/WiFiAnalyzer/ESPWiFiAnalyzerUTF8/ESPWiFiAnalyzerUTF8.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void loop()
340340
for (channel = 2; channel <= 11; channel++) // channels 12-14 may not available
341341
{
342342
idx = channel - 1;
343-
log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
343+
// log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
344344
if (noise_list[idx] < min_noise)
345345
{
346346
min_noise = noise_list[idx];

examples/WiFiAnalyzer/PicoWiFiAnalyzer/PicoWiFiAnalyzer.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ void setup()
9797
gfx->setTextSize(banner_text_size);
9898
gfx->setCursor(0, 0);
9999
gfx->setTextColor(RGB565_WHITE, RGB565_CRIMSON);
100-
gfx->print(" Pico W ");
100+
gfx->print(" Pi");
101+
gfx->setTextColor(RGB565_WHITE, RGB565_DARKORANGE);
102+
gfx->print("co");
103+
gfx->setTextColor(RGB565_WHITE, RGB565_LIMEGREEN);
104+
gfx->print(" W ");
101105
gfx->setTextColor(RGB565_WHITE, RGB565_MEDIUMBLUE);
102106
gfx->print(" WiFi ");
103107
gfx->setTextColor(RGB565_WHITE, RGB565_PURPLE);
@@ -303,7 +307,7 @@ void loop()
303307
for (channel = 2; channel <= 11; channel++) // channels 12-14 may not available
304308
{
305309
idx = channel - 1;
306-
log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
310+
// log_i("min_noise: %d, noise_list[%d]: %d", min_noise, idx, noise_list[idx]);
307311
if (noise_list[idx] < min_noise)
308312
{
309313
min_noise = noise_list[idx];

examples/WiFiAnalyzer/PicoWiFiAnalyzerUTF8/PicoWiFiAnalyzerUTF8.ino

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)