I need help with my project!! URGENT

I am using an ARDUINO UNO.

I have made a strobe light stimulated by ir sensors.

link - - YouTube

I need to alter the speed of the light glowing and dimming and on the first run it was as expected. But then i wanted to change the ON OFF interval of the LED so I changed the led’s delay. But that changed the speed of Serial.print too which I do not want. I had set Serial.print to (20) and led to (300) but the Serial.print too became (300). But in the other case when speed of led is (20) then Serial.print too works at (20).

I want to know that how can i set the delay value of Serial.print independent of other devices on the board.
I have attached the Codes.
Please HELP…
THANKYOU

sketch_apr26b.ino (834 Bytes)

What does "URGENT" mean?

Does it mean you want to jump the queue? That does not seem very nice!

And if you wanted a quick answer it would have helped if you had taken a few minutes to figure out which section of the Forum was for questions about programming.

so I changed the led's delay. But that changed the speed of Serial.print too which I do not want

That is almost certainly because you are using the delay() function which blocks everything until it completes. Have a look at how millis() is used to manage timing without blocking in Several things at a time

...R

Robin2:
What does "URGENT" mean?

Does it mean you want to jump the queue? That does not seem very nice!

And if you wanted a quick answer it would have helped if you had taken a few minutes to figure out which section of the Forum was for questions about programming.

That is almost certainly because you are using the delay() function which blocks everything until it completes. Have a look at how millis() is used to manage timing without blocking in Several things at a time

...R

Perfecto solution.....ty so muchhh!!