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"
|
#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() {
|
void setup() {
|
||||||
// Initialize all modules separately so header stays unused
|
dezibot.begin();
|
||||||
dezibot.multiColorLight.begin();
|
Serial.begin(115200);
|
||||||
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
|
|
||||||
// Wait for Serial to init
|
// Wait for Serial to init
|
||||||
while (!Serial) {
|
while (!Serial) {
|
||||||
;
|
;
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
Serial1.println("Starting Power Management Test");
|
Serial.println("Starting Power Management Test");
|
||||||
Serial1.println("Status on end of setup:");
|
Serial.println("Status on end of setup:");
|
||||||
#ifdef Power_h
|
|
||||||
dezibot.power.dumpPowerStatistics();
|
dezibot.power.dumpPowerStatistics();
|
||||||
dezibot.power.dumpConsumerStatistics();
|
dezibot.power.dumpConsumerStatistics();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpInfoAndWait() {
|
void dumpInfoAndWait() {
|
||||||
@ -38,18 +26,20 @@ void dumpInfoAndWait() {
|
|||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
dezibot.multiColorLight.setLed(ALL, 0x00FFFFFF);
|
dezibot.multiColorLight.setLed(ALL, 0x00FFFFFF);
|
||||||
Serial1.println("Turned on all RGB LEDs");
|
Serial.println("Turned on all RGB LEDs");
|
||||||
#ifdef Power_h
|
|
||||||
dumpInfoAndWait();
|
dumpInfoAndWait();
|
||||||
#endif
|
|
||||||
dezibot.motion.move();
|
dezibot.motion.move();
|
||||||
Serial1.println("Turned on all motors");
|
Serial.println("Turned on all motors");
|
||||||
#ifdef Power_h
|
|
||||||
dumpInfoAndWait();
|
dumpInfoAndWait();
|
||||||
#endif
|
|
||||||
dezibot.infraredLight.bottom.turnOn();
|
dezibot.infraredLight.bottom.turnOn();
|
||||||
Serial1.println("Turned on bottom IR LEDs");
|
Serial.println("Turned on bottom IR LEDs");
|
||||||
#ifdef Power_h
|
dumpInfoAndWait();
|
||||||
|
|
||||||
|
dezibot.multiColorLight.turnOffLed(ALL);
|
||||||
|
dezibot.motion.stop();
|
||||||
|
dezibot.infraredLight.bottom.turnOff();
|
||||||
|
Serial.println("Turned off all LEDs and motors");
|
||||||
dumpInfoAndWait();
|
dumpInfoAndWait();
|
||||||
#endif
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user