From e4dffe50c7b9ea93a063ff7d2abf39cb62c379c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Sun, 24 Nov 2024 23:09:46 +0100 Subject: [PATCH 1/8] Add existing code: Power consumption test cases and Semaphore power scheduler skeleton --- .../Power_Measurements/Display/Display.ino | 26 ++++ .../ESP32_baseline/ESP32_baseline.ino | 136 ++++++++++++++++++ .../advanced/Power_Measurements/IMU/IMU.ino | 43 ++++++ .../Power_Measurements/IR_LED/IR_LED.ino | 23 +++ .../LightSensorsDaylight.ino | 34 +++++ .../LightSensorsDaylightBottom.ino | 34 +++++ .../LightSensorsInfrared.ino | 34 +++++ .../Power_Measurements/Motors/Motors.ino | 22 +++ .../Motors_Full/Motors_Full.ino | 24 ++++ .../Power_Measurements/RGB_LED/RGB_LED.ino | 44 ++++++ .../Power_Measurements/Template/Template.ino | 32 +++++ .../Power_Measurements/VEML6040/VEML6040.ino | 34 +++++ .../advanced/Power_Measurements/WLAN/WLAN.ino | 36 +++++ 13 files changed, 522 insertions(+) create mode 100644 example/advanced/Power_Measurements/Display/Display.ino create mode 100644 example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino create mode 100644 example/advanced/Power_Measurements/IMU/IMU.ino create mode 100644 example/advanced/Power_Measurements/IR_LED/IR_LED.ino create mode 100644 example/advanced/Power_Measurements/LightSensorsDaylight/LightSensorsDaylight.ino create mode 100644 example/advanced/Power_Measurements/LightSensorsDaylightBottom/LightSensorsDaylightBottom.ino create mode 100644 example/advanced/Power_Measurements/LightSensorsInfrared/LightSensorsInfrared.ino create mode 100644 example/advanced/Power_Measurements/Motors/Motors.ino create mode 100644 example/advanced/Power_Measurements/Motors_Full/Motors_Full.ino create mode 100644 example/advanced/Power_Measurements/RGB_LED/RGB_LED.ino create mode 100644 example/advanced/Power_Measurements/Template/Template.ino create mode 100644 example/advanced/Power_Measurements/VEML6040/VEML6040.ino create mode 100644 example/advanced/Power_Measurements/WLAN/WLAN.ino diff --git a/example/advanced/Power_Measurements/Display/Display.ino b/example/advanced/Power_Measurements/Display/Display.ino new file mode 100644 index 0000000..c455fc4 --- /dev/null +++ b/example/advanced/Power_Measurements/Display/Display.ino @@ -0,0 +1,26 @@ +#include "Dezibot.h" + +Dezibot dezibot = Dezibot(); + +// How many times to run a command on the display consecutively; +const uint16_t iterations = 5000; + +void setup() { + dezibot.begin(); +} + +void loop() { + //Typical output + dezibot.display.println("Typical output"); + for(uint16_t iter=0; iter Date: Tue, 28 Jan 2025 20:06:34 +0100 Subject: [PATCH 2/8] Add script to generate clangd configuration --- .gitignore | 9 +++++- tools/generate_clangd_config.sh | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100755 tools/generate_clangd_config.sh diff --git a/.gitignore b/.gitignore index 0eb0b45..4612205 100644 --- a/.gitignore +++ b/.gitignore @@ -34,8 +34,15 @@ docs/* *.out *.app -#VSCode +# VSCode .vscode/* .history/ *.vsix *.workspace + +# Tool-generated files +.cache/ +compile_commands.json + +# Build directories +build/ \ No newline at end of file diff --git a/tools/generate_clangd_config.sh b/tools/generate_clangd_config.sh new file mode 100755 index 0000000..0d43848 --- /dev/null +++ b/tools/generate_clangd_config.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "$0")")" && pwd)" +PROJECT_PATH="$(cd "$SCRIPT_DIR/.." && pwd)" + +# Default values that can be overridden by environment variables +# The ':=' operator means "use the environment variable if set, otherwise use this default" +: "${BOARD_FQBN:=esp32:esp32:esp32s3usbotg:USBMode=hwcdc}" +: "${LIBRARY_PATH:=$PROJECT_PATH}" +: "${BUILD_PATH:=$PROJECT_PATH/build}" +: "${BASE_INO_SKETCH_PATH:=$PROJECT_PATH/example/start}" +: "${COMPILE_COMMANDS:=compile_commands.json}" + + +mkdir -p "$BUILD_PATH" + +if ! command -v arduino-cli >/dev/null 2>&1; then + echo "Error: arduino-cli is not installed or not in PATH" + echo "Please install it from https://arduino.github.io/arduino-cli/latest/installation/" + exit 1 +fi + +echo "Generating clangd configuration for $BOARD_FQBN in $BUILD_PATH" +echo "Based on compilation of $BASE_INO_SKETCH_PATH" +echo "This may take a while and will not produce any output until it's done." +echo "Please be patient..." + +if ! arduino-cli compile \ + --fqbn "$BOARD_FQBN" \ + --library "$LIBRARY_PATH" \ + --only-compilation-database \ + --build-path "$BUILD_PATH" \ + "$BASE_INO_SKETCH_PATH"; then + echo "Error: Failed to generate compilation database" + exit 1 +fi + +# Create symbolic link with error handling +if [ -f "$BUILD_PATH/$COMPILE_COMMANDS" ]; then + ln -sf "$BUILD_PATH/$COMPILE_COMMANDS" "$PROJECT_PATH/$COMPILE_COMMANDS" + echo "Successfully placed clangd configuration in project root" + echo "You no longer have to use the Arduino IDE for code completion \o/" + echo "Feel free to use any editor that supports clangd (e.g via LSP)" + echo "For example, Visual Studio Code with the 'clangd' extension, or VIM (with YouCompleteMe), or Emacs (with Eglot), or ..." + echo "Refer to https://clangd.llvm.org/installation#editor-plugins for more information" + +else + echo "Error: Could not link \"complile_commands.json\" to the root directory. Please manually copy where needed." + exit 1 +fi From eb4859c31d11f20d3e9a5b78cc54dd7fb431bcdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Tue, 28 Jan 2025 20:22:38 +0100 Subject: [PATCH 3/8] Update power measurement examples Update power measurement examples to the state in which they were used as test cases in thesis --- .../Power_Measurements/Display/Display.ino | 2 +- .../ESP32_baseline/ESP32_baseline.ino | 4 ++-- .../Power_Measurements/Motors/Motors.ino | 3 +-- .../advanced/Power_Measurements/WLAN/WLAN.ino | 17 ++++++++--------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/example/advanced/Power_Measurements/Display/Display.ino b/example/advanced/Power_Measurements/Display/Display.ino index c455fc4..0a0a889 100644 --- a/example/advanced/Power_Measurements/Display/Display.ino +++ b/example/advanced/Power_Measurements/Display/Display.ino @@ -3,7 +3,7 @@ Dezibot dezibot = Dezibot(); // How many times to run a command on the display consecutively; -const uint16_t iterations = 5000; +const uint16_t iterations = 1000; void setup() { dezibot.begin(); diff --git a/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino b/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino index e587853..ad1a1cf 100644 --- a/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino +++ b/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino @@ -1,10 +1,10 @@ #include "Dezibot.h" -#include "esp_pm.h" +#include "esp_pm.h" #include "esp_task_wdt.h" Dezibot dezibot; -const uint16_t cycleTime = 2e4; //20000 ms = 20 s +const uint16_t cycleTime = 20e3; esp_pm_lock_handle_t cpuFreqLock; esp_pm_lock_handle_t apbFreqLock; diff --git a/example/advanced/Power_Measurements/Motors/Motors.ino b/example/advanced/Power_Measurements/Motors/Motors.ino index b4f446b..9da99ed 100644 --- a/example/advanced/Power_Measurements/Motors/Motors.ino +++ b/example/advanced/Power_Measurements/Motors/Motors.ino @@ -14,8 +14,7 @@ void loop() { dezibot.motion.rotateAntiClockwise(); delay(20000); // Turn on both motors at the same time - dezibot.motion.left.setSpeed(DEFAULT_BASE_VALUE); - dezibot.motion.right.setSpeed(DEFAULT_BASE_VALUE); + dezibot.motion.move(); delay(20000); dezibot.motion.stop(); delay(20000); diff --git a/example/advanced/Power_Measurements/WLAN/WLAN.ino b/example/advanced/Power_Measurements/WLAN/WLAN.ino index ece11b9..8a780f2 100644 --- a/example/advanced/Power_Measurements/WLAN/WLAN.ino +++ b/example/advanced/Power_Measurements/WLAN/WLAN.ino @@ -4,29 +4,28 @@ Dezibot dezibot = Dezibot(); void setup() { - Serial.begin(112500); - while (!Serial) { - ; /* Wait for USB-CDC Serial init to complete. */ - } #ifdef DEBUG - dezibot.display.begin(); - dezibot.display.println("Debug enabled."); + Serial.begin(112500); Serial.println("Debug enabled."); #endif dezibot.communication.begin(); dezibot.communication.setGroupNumber(1); dezibot.communication.sendMessage("Repeated send power consumption test commencing"); #ifdef DEBUG - dezibot.display.println("Mesh set up"); + Serial.println("Mesh set up"); /* Set up receive handler */ dezibot.communication.onReceive(handle_receive); - dezibot.display.println("Set up receive. Printing incoming messages:"); + Serial.println("Set up receive. Printing incoming messages:"); Serial.println("Sending broadcast messages to generate TX power consumption:"); #endif + delay(5000); + #ifdef DEBUG + Serial.println("Starting Transmission..."); + #endif } void handle_receive(String &message) { - dezibot.display.println(message); + Serial.println(message); } void loop() { From dea3d1307a579e56cedf3ab694b5e43c96bf5045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Thu, 30 Jan 2025 16:01:41 +0100 Subject: [PATCH 4/8] Update ESP32 base load task to have more variety --- .../ESP32_baseline/ESP32_baseline.ino | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino b/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino index ad1a1cf..f6d8b10 100644 --- a/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino +++ b/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino @@ -12,32 +12,32 @@ esp_pm_lock_handle_t lightSleepLock; static bool pmLocksCreated = false; -void stress_task0(void *pvParameters) { - // Register ourselves with the task watchdog - if (esp_task_wdt_add(NULL) != ESP_OK) { - Serial.println("Failed to add task 0 to TWDT"); - } - while (1) { +void stress_task(void *pvParameters) { + // Register with task watchdog + ESP_ERROR_CHECK(esp_task_wdt_add(NULL)); + + // Variables for load generation volatile uint32_t x = 0; - for (uint32_t i = 0; i < 10000; i++) { - x += i; + TickType_t last_wake_time = xTaskGetTickCount(); + + while (1) { + // Compute-intensive period + for (uint32_t i = 0; i < 10000; i++) { + x += i; + // Mix in some memory operations + if (i % 100 == 0) { + // Force cache misses occasionally + void* temp = malloc(32); + if (temp) { + free(temp); + } + } + } + + // Reset watchdog + ESP_ERROR_CHECK(esp_task_wdt_reset()); + } - esp_task_wdt_reset(); - } -} - -void stress_task1(void *pvParameters) { - // Register ourselves with the task watchdog - if (esp_task_wdt_add(NULL) != ESP_OK) { - Serial.println("Failed to add task 0 to TWDT"); - } - while (1) { - volatile uint32_t x = 0; - for (uint32_t i = 0; i < 10000; i++) { - x += i; - } - esp_task_wdt_reset(); - } } void setup() { @@ -113,8 +113,8 @@ void loop() { setupAndCleanupSerialPrint("Beginning stress phase\n"); TaskHandle_t core0StressTask = NULL; TaskHandle_t core1StressTask = NULL; - xTaskCreatePinnedToCore(stress_task0, "CPU0Stress", 4096, NULL, 1, &core0StressTask, 0); - xTaskCreatePinnedToCore(stress_task1, "CPU1Stress", 4096, NULL, 1, &core1StressTask, 1); + xTaskCreatePinnedToCore(stress_task, "CPU0Stress", 4096, NULL, 1, &core0StressTask, 0); + xTaskCreatePinnedToCore(stress_task, "CPU1Stress", 4096, NULL, 1, &core1StressTask, 1); vTaskDelay(pdMS_TO_TICKS(cycleTime)); setupAndCleanupSerialPrint("Still alive after waiting cycleTime after setting up stress tasks...\n"); esp_task_wdt_delete(core0StressTask); From b57e955dc2b7d8ee5ee760fee87d1e52d51a5e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Thu, 30 Jan 2025 18:06:56 +0100 Subject: [PATCH 5/8] Add state signalisation via blipping GPIO17 --- .../ESP32_baseline/ESP32_baseline.ino | 24 +- .../ESP32_baseline/whetstone.c | 230 ++++++++++++++++++ .../advanced/Power_Measurements/WLAN/WLAN.ino | 1 - 3 files changed, 247 insertions(+), 8 deletions(-) create mode 100644 example/advanced/Power_Measurements/ESP32_baseline/whetstone.c diff --git a/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino b/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino index f6d8b10..0144439 100644 --- a/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino +++ b/example/advanced/Power_Measurements/ESP32_baseline/ESP32_baseline.ino @@ -42,9 +42,9 @@ void stress_task(void *pvParameters) { void setup() { Serial.begin(115200); - while (!Serial) { - ; - } + // while (!Serial) { + // ; + // } uint32_t Freq = getCpuFrequencyMhz(); Serial.print("CPU Freq = "); Serial.print(Freq); @@ -87,6 +87,17 @@ void setup() { Serial.end(); } +void blip_io(int times) { + constexpr int ioPin = 17; + pinMode(ioPin, OUTPUT); + for(int i = 0; i 2) + j = 0; + else + j = 1; + + if (j < 1 ) + j = 1; + else + j = 0; + } +#ifdef POUT + pout(n4, j, j, x1, x2, x3, x4); +#endif + +/* MODULE 5: omitted */ + +/* MODULE 6: integer arithmetic */ + + j = 1; + k = 2; + l = 3; + + for (i = 1; i <= n6; i += 1) { + j = j * (k - j) * (l -k); + k = l * k - (l - j) * k; + l = (l - k) * (k + j); + + e1[l - 2] = j + k + l; /* C arrays are zero based */ + e1[k - 2] = j * k * l; + } +#ifdef POUT + pout(n6, j, k, e1[0], e1[1], e1[2], e1[3]); +#endif + +/* MODULE 7: trig. functions */ + + x = y = 0.5; + + for(i = 1; i <= n7; i +=1) { + x = t * atan(t2*sin(x)*cos(x)/(cos(x+y)+cos(x-y)-1.0)); + y = t * atan(t2*sin(y)*cos(y)/(cos(x+y)+cos(x-y)-1.0)); + } +#ifdef POUT + pout(n7, j, k, x, x, y, y); +#endif + +/* MODULE 8: procedure calls */ + + x = y = z = 1.0; + + for (i = 1; i <= n8; i +=1) + p3(x, y, &z); +#ifdef POUT + pout(n8, j, k, x, y, z, z); +#endif + +/* MODULE9: array references */ + + j = 1; + k = 2; + l = 3; + + e1[0] = 1.0; + e1[1] = 2.0; + e1[2] = 3.0; + + for(i = 1; i <= n9; i += 1) + p0(); +#ifdef POUT + pout(n9, j, k, e1[0], e1[1], e1[2], e1[3]); +#endif + +/* MODULE10: integer arithmetic */ + + j = 2; + k = 3; + + for(i = 1; i <= n10; i +=1) { + j = j + k; + k = j + k; + j = k - j; + k = k - j - j; + } +#ifdef POUT + pout(n10, j, k, x1, x2, x3, x4); +#endif + +/* MODULE11: standard functions */ + + x = 0.75; + for(i = 1; i <= n11; i +=1) + x = sqrt( exp( log(x) / t1)); + +#ifdef POUT + pout(n11, j, k, x, x, x, x); +#endif +} + +pa(e) +double e[4]; +{ + register int j; + + j = 0; + lab: + e[0] = ( e[0] + e[1] + e[2] - e[3] ) * t; + e[1] = ( e[0] + e[1] - e[2] + e[3] ) * t; + e[2] = ( e[0] - e[1] + e[2] + e[3] ) * t; + e[3] = ( -e[0] + e[1] + e[2] + e[3] ) / t2; + j += 1; + if (j < 6) + goto lab; +} + + +p3(x, y, z) +double x, y, *z; +{ + x = t * (x + y); + y = t * (x + y); + *z = (x + y) /t2; +} + + +p0() +{ + e1[j] = e1[k]; + e1[k] = e1[l]; + e1[l] = e1[j]; +} + +#ifdef POUT +pout(n, j, k, x1, x2, x3, x4) +int n, j, k; +double x1, x2, x3, x4; +{ + printf("%6d%6d%6d %5e %5e %5e %5e\n", + n, j, k, x1, x2, x3, x4); +} +#endif diff --git a/example/advanced/Power_Measurements/WLAN/WLAN.ino b/example/advanced/Power_Measurements/WLAN/WLAN.ino index 8a780f2..a4cfcd3 100644 --- a/example/advanced/Power_Measurements/WLAN/WLAN.ino +++ b/example/advanced/Power_Measurements/WLAN/WLAN.ino @@ -31,5 +31,4 @@ void handle_receive(String &message) { void loop() { /* Continuously send to consume power on TX */ dezibot.communication.sendMessage("Power Test Message"); - } \ No newline at end of file From 9acca9e5c77f4dde578d8537343a2d34d136493a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Mon, 3 Feb 2025 20:58:00 +0100 Subject: [PATCH 6/8] Update Measurement sketches --- .../Power_Measurements/IR_LED/IR_LED.ino | 15 +++- .../RGB_LED_direct/RGB_LED_direct.ino | 80 +++++++++++++++++++ .../Power_Measurements/VEML6040/VEML6040.ino | 6 +- .../advanced/Power_Measurements/WLAN/WLAN.ino | 13 +++ 4 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 example/advanced/Power_Measurements/RGB_LED_direct/RGB_LED_direct.ino diff --git a/example/advanced/Power_Measurements/IR_LED/IR_LED.ino b/example/advanced/Power_Measurements/IR_LED/IR_LED.ino index 3bffc84..cc19a12 100644 --- a/example/advanced/Power_Measurements/IR_LED/IR_LED.ino +++ b/example/advanced/Power_Measurements/IR_LED/IR_LED.ino @@ -9,15 +9,26 @@ void setup() { dezibot.infraredLight.begin(); } +void blink_times(int times) { + constexpr int ioPin = 17; + pinMode(ioPin, OUTPUT); + for(int i = 0; i + +/* +╔══════════════════════════════════════════════════════════════════════════════╗ +║ WARNING: This example controls the RGB-LEDs directly, bypassing the ║ +║ MultiColorLight component. This is not recommended for normal use, as it ║ +║ bypasses the safety checks and color normalization. This is only intended ║ +║ for diagnostic purposes. ║ +╚══════════════════════════════════════════════════════════════════════════════╝ +*/ + +Adafruit_NeoPixel rgbLeds(3, 48); + +void setup() { rgbLeds.begin(); } + +void loop() { + // Ramp up the brightness of each color channel + // Allows for the PWM behaviour to quickly be observed on an oscilloscope + // Red + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(bri, 0, 0)); + rgbLeds.show(); + delay(10); + } + // Red + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(0, bri, 0)); + rgbLeds.show(); + delay(10); + } + // Blue + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(0, 0, bri)); + rgbLeds.show(); + delay(10); + } + // Combinations of the color channels + // Yellow (Red + Green) + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(bri, bri, 0)); + rgbLeds.show(); + delay(10); + } + // Purple (Red + Blue) + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(bri, 0, bri)); + rgbLeds.show(); + delay(10); + } + // Cyan (Green + Blue) + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(0, bri, bri)); + rgbLeds.show(); + delay(10); + } + // White (Red + Green + Blue) + for (int bri = 0; bri < 0xFF; bri += 0x1) { + rgbLeds.setPixelColor(0, rgbLeds.Color(bri, bri, bri)); + rgbLeds.show(); + delay(10); + } + + // Now some constant states for comparable measurements + // Full brightness R+G+B + rgbLeds.setPixelColor(0, rgbLeds.Color(255, 255, 255)); + rgbLeds.show(); + sleep(5); + // Half brightness R+G+B + rgbLeds.setPixelColor(0, rgbLeds.Color(127, 127, 127)); + rgbLeds.show(); + sleep(5); + // Minimum brightness R+G+B + rgbLeds.setPixelColor(0, rgbLeds.Color(1, 1, 1)); + rgbLeds.show(); + sleep(5); + // Off (baseline) + rgbLeds.setPixelColor(0, rgbLeds.Color(0, 0, 0)); + rgbLeds.show(); + sleep(5); +} diff --git a/example/advanced/Power_Measurements/VEML6040/VEML6040.ino b/example/advanced/Power_Measurements/VEML6040/VEML6040.ino index 6c821be..07a87e1 100644 --- a/example/advanced/Power_Measurements/VEML6040/VEML6040.ino +++ b/example/advanced/Power_Measurements/VEML6040/VEML6040.ino @@ -3,7 +3,7 @@ Dezibot dezibot; void setup() { - dezibot.lightDetection.begin(); + dezibot.colorDetection.begin(); //dezibot.motion.detection.end(); // put your setup code here, to run once: Serial.begin(115200); @@ -13,7 +13,7 @@ void setup() { } delay(1000); // Test if VEML6040 is working correctly - char light_value = dezibot.lightDetection.getValue(DL_FRONT); + char light_value = dezibot.colorDetection.getColorValue(VEML_WHITE); if (light_value != UINT16_MAX) { Serial.printf("Light detection seems to be working (detected value: %d). Starting measurements...\r\n", light_value); } else { @@ -29,6 +29,6 @@ void setup() { void loop() { // put your main code here, to run repeatedly: - dezibot.lightDetection.getValue(DL_FRONT); + dezibot.colorDetection.getColorValue(VEML_WHITE); delay(10); } \ No newline at end of file diff --git a/example/advanced/Power_Measurements/WLAN/WLAN.ino b/example/advanced/Power_Measurements/WLAN/WLAN.ino index a4cfcd3..0bc695a 100644 --- a/example/advanced/Power_Measurements/WLAN/WLAN.ino +++ b/example/advanced/Power_Measurements/WLAN/WLAN.ino @@ -3,6 +3,17 @@ Dezibot dezibot = Dezibot(); +void blip_io(int times) { + constexpr int ioPin = 17; + pinMode(ioPin, OUTPUT); + for(int i = 0; i Date: Wed, 5 Feb 2025 17:10:20 +0100 Subject: [PATCH 7/8] Update display test case --- example/advanced/Power_Measurements/Display/Display.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/advanced/Power_Measurements/Display/Display.ino b/example/advanced/Power_Measurements/Display/Display.ino index 0a0a889..972d9b6 100644 --- a/example/advanced/Power_Measurements/Display/Display.ino +++ b/example/advanced/Power_Measurements/Display/Display.ino @@ -23,4 +23,10 @@ void loop() { dezibot.display.println(iter); } delay(10); + //Completely off + dezibot.display.clear() + sleep(10); + //Completely on + dezibot.display.invertColor(); + sleep(10); } \ No newline at end of file From 8a2e27f6f77ab4c52811c607a14c0a17ef5fb242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Sun, 9 Feb 2025 20:16:54 +0100 Subject: [PATCH 8/8] Update test cases --- example/advanced/Power_Measurements/Display/Display.ino | 2 +- example/advanced/Power_Measurements/WLAN/WLAN.ino | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/example/advanced/Power_Measurements/Display/Display.ino b/example/advanced/Power_Measurements/Display/Display.ino index 972d9b6..7cab3a0 100644 --- a/example/advanced/Power_Measurements/Display/Display.ino +++ b/example/advanced/Power_Measurements/Display/Display.ino @@ -24,7 +24,7 @@ void loop() { } delay(10); //Completely off - dezibot.display.clear() + dezibot.display.clear(); sleep(10); //Completely on dezibot.display.invertColor(); diff --git a/example/advanced/Power_Measurements/WLAN/WLAN.ino b/example/advanced/Power_Measurements/WLAN/WLAN.ino index 0bc695a..180b2aa 100644 --- a/example/advanced/Power_Measurements/WLAN/WLAN.ino +++ b/example/advanced/Power_Measurements/WLAN/WLAN.ino @@ -44,4 +44,5 @@ void handle_receive(String &message) { void loop() { /* Continuously send to consume power on TX */ dezibot.communication.sendMessage("Power Test Message"); + sleep(2); } \ No newline at end of file