// constants won't change. Used here to set a pin number:
const int ledPin = LED_BUILTIN; // the number of the LED pin
const long interval1 = 1000; // interval at which to blink (milliseconds)
const long interval2 = 100; // interval at which to blink (milliseconds)
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long start1 = 0; //
unsigned long start2 = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void TimeLed() //led ze zije procesor
{
unsigned long cas = millis();
if (cas - start1 >= interval1) //rozsviti led každou sec
{
start1 = cas;
digitalWrite(ledPin, HIGH);
}
if (cas - start1 >= interval2) //zhasne led po 100 ms každou sec
{
start2 = cas;
digitalWrite(ledPin,LOW);
}
}
void loop()
{
TimeLed();
}