// unsigned long previousMillis = 0;
// bool ledState = LOW;
// void setup() {
// pinMode(13, OUTPUT);
// }
// void loop() {
// unsigned long currentMillis = millis();
// if (currentMillis - previousMillis >= 200) {
// previousMillis = currentMillis;
// ledState = !ledState;
// digitalWrite(13, ledState);
// }
// }
const int ledPin = 13;
const int interval = 500;
unsigned long previousMillis = 0;
bool ledState = LOW;
void setup() { pinMode(ledPin, OUTPUT);
}
void loop() {
unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis; ledState = !ledState;
digitalWrite(ledPin, ledState); }
} // дз 1