/*************************
*
* Blink
* 2023-12-22
***************************/
#include <avr/delay.h>
#define pinLed PB5
#define pinBlue PD7
uint32_t millisPreviousBlue = 0;
uint32_t millisPassedBlue = 1000;
void setup() {
DDRB |= _BV(pinLed);
DDRD |= _BV(pinBlue);
}
void doBlink(byte pin, byte anz, word onTime, word offTime){
for (byte d=0; d<anz; d++){
PORTB |= _BV(pinLed);
_delay_ms(onTime);
PORTB &=~ _BV(pinLed);
_delay_ms(offTime);
}
}
void loop() {
if (millis() > millisPreviousBlue + millisPassedBlue){
PORTD ^= _BV(pinBlue);
millisPreviousBlue = millis();
}
// doBlink(pinLed, 3, 125, 875);
//_delay_ms(1000);
}