mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 11:01:46 +02:00
Update test case
This commit is contained in:
parent
598ac75e32
commit
c7e1af334f
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user