Feat: Změny

This commit is contained in:
Bruno
2023-05-17 10:44:09 +02:00
parent cc4fd9b2c2
commit 0d158423fc
11 changed files with 100 additions and 32 deletions
BIN
View File
Binary file not shown.
-1
View File
@@ -16,4 +16,3 @@ monitor_speed = 115200
lib_deps =
WiFi
ArduinoJson
WebSocketsClient
+3 -3
View File
@@ -3,7 +3,7 @@
#include <ArduinoJson.h>
const int scanIterations = 5;
const int maxChannel = 14; // Maximum number of Wi-Fi channels in the 2.4 GHz band
const int maxChannel = 14;
int channelUsage[maxChannel] = {0};
void setup() {
@@ -31,14 +31,14 @@ void loop() {
delay(1000);
}
// Create a JSON object to store channel usage data
StaticJsonDocument<256> jsonDocument;
JsonObject channelUsageJson = jsonDocument.to<JsonObject>();
for (int channelIndex = 0; channelIndex < maxChannel; channelIndex++) {
String channel = String(channelIndex + 1);
channelUsageJson[channel] = channelUsage[channelIndex];
channelUsage[channelIndex] = 0; // Reset channel usage counter for the next analysis
channelUsage[channelIndex] = 0;
}
// Serialize and print the JSON object