mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 18:14:31 +02:00
Add existing code: Power consumption test cases and Semaphore power scheduler skeleton
This commit is contained in:
36
example/advanced/Power_Measurements/WLAN/WLAN.ino
Normal file
36
example/advanced/Power_Measurements/WLAN/WLAN.ino
Normal file
@ -0,0 +1,36 @@
|
||||
#include "Dezibot.h"
|
||||
#define DEBUG
|
||||
|
||||
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.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");
|
||||
/* Set up receive handler */
|
||||
dezibot.communication.onReceive(handle_receive);
|
||||
dezibot.display.println("Set up receive. Printing incoming messages:");
|
||||
Serial.println("Sending broadcast messages to generate TX power consumption:");
|
||||
#endif
|
||||
}
|
||||
|
||||
void handle_receive(String &message) {
|
||||
dezibot.display.println(message);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
/* Continuously send to consume power on TX */
|
||||
dezibot.communication.sendMessage("Power Test Message");
|
||||
|
||||
}
|
Reference in New Issue
Block a user