still run functions while in delay

seem to have a problem that while a function is running which has some delays and digitally increments the brightness of an LED it seems I cannot run anything in between. is there a way to check for example, a button press, while something is in a delay or being incremented?

Perfect!
Thanks, that's exactly what I was looking for.

thanks Nick!

ok since I am using an Unsigned Integer in this example which can hold a decent count (4,294,967,295) is that a concern of the program crashing? (this thing might be on for several days) Is there a standard practice of reseting the count when it gets to a certain value? that seems like the likely solution...

hilukasz:
ok since I am using an Unsigned Integer and that can hold a decent count (4,294,967,295) is that a concern of the program crashing? Is there a standard practice of reseting the count when it gets to a certain value? that seems like the likely solution...

No concerns. As Nick told in the tutorial as long as you arrange your elapsed time testing calculations as a subtraction there is no hazards to deal with.

Lefty

hilukasz:
ok since I am using an Unsigned Integer in this example which can hold a decent count (4,294,967,295)

No, it won't. 65535.

hilukasz:
ok since I am using an Unsigned Integer in this example which can hold a decent count (4,294,967,295) is that a concern of the program crashing? (this thing might be on for several days) Is there a standard practice of reseting the count when it gets to a certain value? that seems like the likely solution...

ints are 16-bit

lonbs are 32-bit.

Arrch:

hilukasz:
ok since I am using an Unsigned Integer in this example which can hold a decent count (4,294,967,295) is that a concern of the program crashing? (this thing might be on for several days) Is there a standard practice of reseting the count when it gets to a certain value? that seems like the likely solution...

ints are 16-bit

lonbs are 32-bit.

LOL. lonbs, Is that one of those fancy new C++ data types?

someone should fix the arduino documentation then :stuck_out_tongue: http://arduino.cc/en/Reference/UnsignedLong

unsigned int is not the same thing as unsigned long

See this: http://arduino.cc/en/Reference/UnsignedInt

You said:

... since I am using an Unsigned Integer in this example ...

ooo, you're right. had that pulled up 2am last night when I was reading it. doh. guess I was referring to the tutorial though, it uses a UL or unsigned long. But I see better now how it is used.