diff --git a/example/advanced/Power_Management_Test/Power_Management_Test.ino b/example/advanced/Power_Management_Test/Power_Management_Test.ino index 16cd0a7..a891ca5 100644 --- a/example/advanced/Power_Management_Test/Power_Management_Test.ino +++ b/example/advanced/Power_Management_Test/Power_Management_Test.ino @@ -1,32 +1,20 @@ #include "Dezibot.h" -#define HEADER_SERIAL -#define HEADER_SERIAL_RX_PIN 16 -#define HEADER_SERIAL_TX_PIN 17 -Dezibot dezibot; +std::Dezibot dezibot; void setup() { - // Initialize all modules separately so header stays unused - dezibot.multiColorLight.begin(); - dezibot.motion.begin(); - dezibot.infraredLight.begin(); - - #ifdef HEADER_SERIAL - Serial1.begin(115200, SERIAL_8N1, HEADER_SERIAL_RX_PIN, HEADER_SERIAL_TX_PIN); - #else - Serial1.begin(115200); - #endif + dezibot.begin(); + Serial.begin(115200); // Wait for Serial to init while (!Serial) { ; ; } - Serial1.println("Starting Power Management Test"); - Serial1.println("Status on end of setup:"); - #ifdef Power_h + Serial.println("Starting Power Management Test"); + Serial.println("Status on end of setup:"); + dezibot.power.dumpPowerStatistics(); dezibot.power.dumpConsumerStatistics(); - #endif } void dumpInfoAndWait() { @@ -38,18 +26,20 @@ void dumpInfoAndWait() { void loop() { dezibot.multiColorLight.setLed(ALL, 0x00FFFFFF); - Serial1.println("Turned on all RGB LEDs"); - #ifdef Power_h + Serial.println("Turned on all RGB LEDs"); dumpInfoAndWait(); - #endif + dezibot.motion.move(); - Serial1.println("Turned on all motors"); - #ifdef Power_h + Serial.println("Turned on all motors"); dumpInfoAndWait(); - #endif + dezibot.infraredLight.bottom.turnOn(); - Serial1.println("Turned on bottom IR LEDs"); - #ifdef Power_h + 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(); - #endif } \ No newline at end of file