mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 18:14:31 +02:00
Add existing code: Power consumption test cases and Semaphore power scheduler skeleton
This commit is contained in:
44
example/advanced/Power_Measurements/RGB_LED/RGB_LED.ino
Normal file
44
example/advanced/Power_Measurements/RGB_LED/RGB_LED.ino
Normal file
@ -0,0 +1,44 @@
|
||||
#include "Dezibot.h"
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
|
||||
void setup() {
|
||||
dezibot.multiColorLight.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
/* Loop through the LEDs at full brightness for measurements, with 20 seconds to measure for each state */
|
||||
for (int state = 0; state < 6; state++) {
|
||||
switch (state) {
|
||||
case 0:
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
break;
|
||||
case 1:
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
delay(10);
|
||||
dezibot.multiColorLight.setLed(TOP_LEFT,WHITE);
|
||||
break;
|
||||
case 2:
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
delay(10);
|
||||
dezibot.multiColorLight.setLed(TOP_RIGHT,WHITE);
|
||||
break;
|
||||
case 3:
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
delay(10);
|
||||
dezibot.multiColorLight.setLed(BOTTOM,WHITE);
|
||||
break;
|
||||
case 4:
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
delay(10);
|
||||
dezibot.multiColorLight.setLed(TOP,WHITE);
|
||||
break;
|
||||
case 5:
|
||||
dezibot.multiColorLight.turnOffLed(ALL);
|
||||
delay(10);
|
||||
dezibot.multiColorLight.setLed(ALL,WHITE);
|
||||
break;
|
||||
}
|
||||
sleep(20);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user