programming

Status
Not open for further replies.
Millions of reasons why. A few of the more common reasons being waiting for external input, turning on an LED for 1 second (LEDon; Delay(1); LEDoff; ), waiting for a routine to finish, waiting for a device to become ready. You'll know when you need to use it.
 
Last edited:
Note that when using delay(), usually (I can't say in all instances - depends on how the delay() function is implemented in the library and the microcontroller used) the rest of your program is "suspended" during the delay; you can, however, write a different set of routines that can work similar to delay() to allow you to continue doing processing (a form of multitasking) if you need to (however, the timing of this new delay function probably won't be as accurate).
 
It aims to create a delay.Now depending upon your need the usage will vary.It engages the system in some other loop & hence creating required delay.Interrupts will work as usual & delay function can be interrupted .
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…