mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 11:01:46 +02:00
35 lines
772 B
C++
35 lines
772 B
C++
#include "Dezibot.h"
|
|
|
|
Dezibot dezibot;
|
|
|
|
const uint16_t cycleMillis = 2e4;
|
|
|
|
void setup() {
|
|
// put your setup code here, to run once:
|
|
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);
|
|
blink_times(2);
|
|
dezibot.infraredLight.bottom.turnOff();
|
|
}
|