mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 11:01:46 +02:00
34 lines
899 B
C++
34 lines
899 B
C++
#include "Dezibot.h"
|
|
#define DEBUG
|
|
|
|
Dezibot dezibot = Dezibot();
|
|
|
|
void setup() {
|
|
#ifdef DEBUG
|
|
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
|
|
Serial.println("Mesh set up");
|
|
/* Set up receive handler */
|
|
dezibot.communication.onReceive(handle_receive);
|
|
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) {
|
|
Serial.println(message);
|
|
}
|
|
|
|
void loop() {
|
|
/* Continuously send to consume power on TX */
|
|
dezibot.communication.sendMessage("Power Test Message");
|
|
} |