Send Message When LEDS Blink

Hello Group!

I have a simple question. Where should I place my serial print messages so that it sends a message to the serial monitor each time the LED blinks on and blinks off? Code below Thanks!

if(n == 39) {
isFlashing = true;
}

if (isFlashing) {  
if (millis () - CRFtimer5 >= 300){
Serial.println("BLINKING ON"); // THIS PRINTS MULTIPLE TIMES
if (CRFtimer5 > millis()) return;
CRFState5 = ~CRFState5;
digitalWrite(13,  CRFState5);  
digitalWrite(13, ~CRFState5);
CRFtimer5 = millis()+CRFinterval5;
lastFlash = millis ();
}
}

Which line blinks the led? Put the serial print right before or after that line. If it is inside an if statement, then make sure the print is inside the same if block.

@Delta_G:

I figured it out. I added this piece of code to the top of the first IF statement to keep it from being printed over and over again:

boolean hasPrinted = false;

if(!hasPrinted1) {
Serial.println("ABL");
hasPrinted1 = true;
}

@Delta_G

Now my next question is. How do I send a message to the serial monitor each time the LED blinks?

unsigned long CRFtimer5          = 0;
const unsigned long CRFinterval5 =  900UL;

CRFtimer5 = millis()+CRFinterval5; // THIS CONTROLS THE BLINKING INTERVALS

@Delta_G:

Nevermind again....figured out again edited code:

CRFtimer5 = millis()+CRFinterval5+Serial.println("LED Blinking");
CRFtimer5 = millis()+CRFinterval5+Serial.println("LED Blinking");

Almost certainly not. You don't want to add the return value of the println command to your timing variable.

CRFtimer5 = millis()+CRFinterval5;
Serial.println("LED Blinking");

By the way, your timing isn't safe at rollover. You should use the subtraction method from the Blink Without Delay example. Have a look at any of the thousands of great tutorials on that topic for better explanation.