mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-20 11:31:48 +02:00
Update power measurement examples
Update power measurement examples to the state in which they were used as test cases in thesis
This commit is contained in:
parent
d042c2a437
commit
eb4859c31d
@ -3,7 +3,7 @@
|
|||||||
Dezibot dezibot = Dezibot();
|
Dezibot dezibot = Dezibot();
|
||||||
|
|
||||||
// How many times to run a command on the display consecutively;
|
// How many times to run a command on the display consecutively;
|
||||||
const uint16_t iterations = 5000;
|
const uint16_t iterations = 1000;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
dezibot.begin();
|
dezibot.begin();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "Dezibot.h"
|
#include "Dezibot.h"
|
||||||
#include "esp_pm.h"
|
#include "esp_pm.h"
|
||||||
#include "esp_task_wdt.h"
|
#include "esp_task_wdt.h"
|
||||||
|
|
||||||
Dezibot dezibot;
|
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 cpuFreqLock;
|
||||||
esp_pm_lock_handle_t apbFreqLock;
|
esp_pm_lock_handle_t apbFreqLock;
|
||||||
|
@ -14,8 +14,7 @@ void loop() {
|
|||||||
dezibot.motion.rotateAntiClockwise();
|
dezibot.motion.rotateAntiClockwise();
|
||||||
delay(20000);
|
delay(20000);
|
||||||
// Turn on both motors at the same time
|
// Turn on both motors at the same time
|
||||||
dezibot.motion.left.setSpeed(DEFAULT_BASE_VALUE);
|
dezibot.motion.move();
|
||||||
dezibot.motion.right.setSpeed(DEFAULT_BASE_VALUE);
|
|
||||||
delay(20000);
|
delay(20000);
|
||||||
dezibot.motion.stop();
|
dezibot.motion.stop();
|
||||||
delay(20000);
|
delay(20000);
|
||||||
|
@ -4,29 +4,28 @@
|
|||||||
Dezibot dezibot = Dezibot();
|
Dezibot dezibot = Dezibot();
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(112500);
|
|
||||||
while (!Serial) {
|
|
||||||
; /* Wait for USB-CDC Serial init to complete. */
|
|
||||||
}
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
dezibot.display.begin();
|
Serial.begin(112500);
|
||||||
dezibot.display.println("Debug enabled.");
|
|
||||||
Serial.println("Debug enabled.");
|
Serial.println("Debug enabled.");
|
||||||
#endif
|
#endif
|
||||||
dezibot.communication.begin();
|
dezibot.communication.begin();
|
||||||
dezibot.communication.setGroupNumber(1);
|
dezibot.communication.setGroupNumber(1);
|
||||||
dezibot.communication.sendMessage("Repeated send power consumption test commencing");
|
dezibot.communication.sendMessage("Repeated send power consumption test commencing");
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
dezibot.display.println("Mesh set up");
|
Serial.println("Mesh set up");
|
||||||
/* Set up receive handler */
|
/* Set up receive handler */
|
||||||
dezibot.communication.onReceive(handle_receive);
|
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:");
|
Serial.println("Sending broadcast messages to generate TX power consumption:");
|
||||||
#endif
|
#endif
|
||||||
|
delay(5000);
|
||||||
|
#ifdef DEBUG
|
||||||
|
Serial.println("Starting Transmission...");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_receive(String &message) {
|
void handle_receive(String &message) {
|
||||||
dezibot.display.println(message);
|
Serial.println(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user