// Blink Without Delay example.
//
// So, everyone wants newbies to write blink without delay. This is good,
// because delay() is bad. Well, here's a simple way to do it..
// Have fun!
// jim lee, 
// https://github.com/leftCoast/LC_baseTools/tree/master/examples/blinkWithoutDelay_2
//
// modified by Edoctoor Feb 1, 2022

#include "blinker.h"

// optional blinker attributes.
#define BLINK_PERIOD  800  // Ms
#define BLINK_LIT     100   // ms
#define BLINK_PIN     2     // Pin NUM


// Allocate a global blinker object with default attributes.
// default pin 13; default time on 50 ms; default total period 400 ms
blinker aBlinker;

// Allocate a global blinker object with optional controls attributes.
blinker bBlinker(BLINK_PIN, BLINK_LIT, BLINK_PERIOD); ;


void setup() {

  // fire it up.
  aBlinker.setOnOff(true);
  bBlinker.setOnOff(true);

  Serial.begin(115200);
}


void loop() {

  // blinker is an idler. Calling idle() once in the loop lets ALL idlers run.
  idle();

  // Example of how sleep(); doesn't not affect blinker nor mechButton
  // Use sleep instead of delay from now on; sleep does not pause idle()
  sleep(60000);
  Serial.println("Prints every minute");
}