Update Measurement sketches

This commit is contained in:
2025-02-03 20:58:00 +01:00
parent b57e955dc2
commit 9acca9e5c7
4 changed files with 109 additions and 5 deletions

View File

@ -9,15 +9,26 @@ void setup() {
dezibot.infraredLight.begin();
}
void blink_times(int times) {
constexpr int ioPin = 17;
pinMode(ioPin, OUTPUT);
for(int i = 0; i<times; i++) {
digitalWrite(ioPin,1);
delay(300);
digitalWrite(ioPin,0);
delay(300);
}
}
void loop() {
// put your main code here, to run repeatedly:
// Just turn the lights on alternating each five seconds, to get the consumption
dezibot.infraredLight.front.turnOn();
blink_times(1);
delay(cycleMillis);
dezibot.infraredLight.front.turnOff();
dezibot.infraredLight.bottom.turnOn();
delay(cycleMillis);
//Turn off and wait a little to measure baseline consumption
blink_times(2);
dezibot.infraredLight.bottom.turnOff();
delay(cycleMillis);
}