mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 02:01:42 +02:00
Add power test cases
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
#include "Dezibot.h"
|
||||
|
||||
/*
|
||||
* This serves as an example of how to use the power management system deals with huge requests
|
||||
* for power on an already heavily loaded system.
|
||||
*/
|
||||
|
||||
Dezibot dezibot;
|
||||
|
||||
void setup() {
|
||||
dezibot.begin();
|
||||
Serial.begin(115200);
|
||||
// Wait for Serial to init
|
||||
while (!Serial) {
|
||||
;
|
||||
;
|
||||
}
|
||||
Serial.println("Starting Power Management Test");
|
||||
Serial.println("Status on end of setup:");
|
||||
|
||||
dezibot.power.dumpPowerStatistics();
|
||||
dezibot.power.dumpConsumerStatistics();
|
||||
}
|
||||
|
||||
void dumpInfoAndWait() {
|
||||
delay(100);
|
||||
dezibot.power.dumpPowerStatistics();
|
||||
dezibot.power.dumpConsumerStatistics();
|
||||
delay(900);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
dezibot.multiColorLight.setLed(ALL, 0x00FFFFFF);
|
||||
Serial.println("Turned on all RGB LEDs");
|
||||
dumpInfoAndWait();
|
||||
|
||||
dezibot.motion.move();
|
||||
Serial.println("Turned on all motors");
|
||||
dumpInfoAndWait();
|
||||
|
||||
dezibot.infraredLight.bottom.turnOn();
|
||||
Serial.println("Turned on bottom IR LEDs");
|
||||
dumpInfoAndWait();
|
||||
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
dezibot.motion.stop();
|
||||
dezibot.infraredLight.bottom.turnOff();
|
||||
Serial.println("Turned off all LEDs and motors");
|
||||
dumpInfoAndWait();
|
||||
}
|
Reference in New Issue
Block a user