mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 02:01:42 +02:00
Update Measurement sketches
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user