how can run something for 1 min during running every things in my program ?

hey all :slight_smile:

how can run something for 1 min during running every things in my program ?

when I use dellay() the program wait to finish the delay time after that do the other things !!

thanks all

Take a look at the BlinkWithoutDelay example in the Arduino IDE. That uses the exact concept you need.

ealkhteeb:
hey all :slight_smile:

how can run something for 1 min during running every things in my program ?

when I use dellay() the program wait to finish the delay time after that do the other things !!

thanks all

Check out this library: Arduino Playground - HomePage

TimerOne lets you setup (VERY easily) a timed interrupt driven code execution.

That is, you could write a block of code, point to it with TimerOne and set the interval to 60 seconds (or whatever you want).

Then (independently of other code that's running), your special block of code will be called and run by TimerOne. It will be called every "X" seconds (whatever you chose) regardless of how much time the rest of your code uses.

All it really does is setup an ISR for you, but it takes all the grief out of calculating timer values, setting up timers to fire at the right time, etc....

Check it out - it may be what you're looking for.

sorry
put in your loop

long int waittime = 60000
if startrequired starttime=millis()
if millis() > (starttime+ waittime) then timerisended=true

shooter:
sorry
put in your loop

long int waittime = 60000
if startrequired starttime=millis()
if millis() > (starttime+ waittime) then timerisended=true

that should be
if (millis() - starttime > waittime) timerisended=true;

Krupski:
Check out this library: Arduino Playground - HomePage

TimerOne lets you setup (VERY easily) a timed interrupt driven code execution.

But that won't fire during a delay will it? Doesn't the delay function stop interrupts?