Add existing code: Power consumption test cases and Semaphore power scheduler skeleton

This commit is contained in:
2024-11-24 23:09:46 +01:00
parent fb35d065af
commit 8eeb829a91
15 changed files with 597 additions and 0 deletions

View File

@ -0,0 +1,34 @@
#include "Dezibot.h"
Dezibot dezibot;
void setup() {
dezibot.lightDetection.begin();
//dezibot.motion.detection.end();
// put your setup code here, to run once:
Serial.begin(115200);
// Wait for Serial to init
while (!Serial) {
;;
}
delay(1000);
// Test if SFH325 (Q3) is working correctly
char light_value = dezibot.lightDetection.getValue(DL_FRONT);
if (light_value != UINT16_MAX) {
Serial.printf("Light detection seems to be working (detected value: %d). Starting measurements...\r\n", light_value);
} else {
Serial.printf("Light detection does not seem to be working correctly (detected value: %d).\n",light_value);
exit(0);
}
Serial.println("Killing Serial peripheral now to not influence anything. Goodbye!");
delay(1000);
Serial.flush();
Serial.end();
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
dezibot.lightDetection.getValue(DL_FRONT);
delay(10);
}