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 ();
}
}
@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");