/*
  Arduino | coding-help
  Timer help for LED!
  rana — 10/20/2025 10:27 PM
*/
#include <Arduino.h>
#include "led.h"
unsigned long lastPrint = 0;
myLed led_one(8);
void setup() {
  Serial.begin(9600);
  Serial.println("helo");
}
void loop() {
  led_one.update();
  int count = led_one.getSeconds();
  if (count % 3 == 0 && (count != 0))
  {
    led_one.setStateOn();
  }
  else
  {
    led_one.setStateOff();
  }
  //an issue I kept running into was my serial monitor being flooded by numbers and I wasn't sure what it was
  //I did some checking and just found an old forum that recommends using this conditional statement
  //but I am still unsure as to why this happens....
  //is it because the internal clock and the monitor are not at the same frequency???
  if (millis() - lastPrint >= 960)  // skips / doubles counts more often at 1000
  {
    lastPrint = millis();
    Serial.println(count);
  }
}