Content originally posted in LPCWare by TheFallGuy on Thu Mar 06 07:19:05 MST 2014
In many of the examples, you will find a function called "systick_delay". As you haven't told us what MCU you are using, I can't point you at a specific example, but I think this function exists for every family.
It uses the systick timer to measure the time - using a timer is the only way you can get an accurate delay - it is not possible with delay loops.