/* Blink_millisDelay Turns on an LED on for one second, then off for one second, repeatedly. (c)2018 Forward Computing and Control Pty. Ltd. This example code is in the public domain. */ #include // Pin 13 has an LED connected on most Arduino boards, including NanoV2 int led = 13; bool ledOn = false; millisDelay ledDelay; const unsigned long DELAY_TIME = 1000; // ms == 1sec // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); ledDelay.start(DELAY_TIME); } // the loop routine runs over and over again forever: void loop() { // do other stuff here if (ledDelay.justFinished()) { ledDelay.repeat(); // start a repeat the delay ledOn = !ledOn; // toggle state if (ledOn) { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) } else { digitalWrite(led, LOW); // turn the LED off by making the voltage LOW } } }