/*
* Created by ArduinoGetStarted.com
*
* This example code is in the public domain
*
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-led-blink
*
*/
// #include "ansi.h"
// ANSI ansi(&Serial);
unsigned long ON = 5000;
unsigned long OFF = 5000;
// the setup function runs once when you press reset or power the board
void setup()
{
// initialize digital pin 9 as an output.
pinMode(9, OUTPUT);
pinMode(2, OUTPUT);
Serial.begin(9600);
randomSeed(analogRead(0));
}
// the loop function runs over and over again forever
void loop()
{
//Print to serial output
// Serial.println (random(5, 15));
// Serial.println (ON);
//Blink LED
// randomSeed(analogRead(0));
ON = random(5, 15) * 60000;
OFF = random (5, 10) * 60000;
Serial.println("ON");
Serial.println (ON);
Serial.println ("OFF");
Serial.println (OFF);
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
// delay(500); // wait
delay(ON); // Wait "ON" milliseconds
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
// delay(500); // wait
delay (OFF);
}