Time Delays

Functions

void delay_ms (unsigned int t)
void delay_us (unsigned int t)

Function Documentation

void delay_ms ( unsigned int  t  ) 

Delay for the specified number of milliseconds.

Implemented using busy-waiting, so time spent in ISRs does not count. This is also only an approximate delay.

Note: must be compiled with F_CPU set for the target system clock configuration. We assume that F_CPU is divisible by 4000

Parameters:
t Number of milliseconds to delay.
Author:
Andrew H. Fagg
void delay_us ( unsigned int  t  )  [inline]

Delay for the specified number of microseconds.

Implemented using busy-waiting, so time spent in ISRs does not count. This is also only an approximate delay.

Note: must be compiled with F_CPU set for the target system clock configuration. We assume that F_CPU is divisible by 1,000,000

Parameters:
t Number of microseconds to delay.
For 1MHz clock: delay up to 65535 us, with a resolution of 4 us
For 16MHz clock: delay up to 4095 us, with a resolution of 1 us
Author:
Andrew H. Fagg
Generated on Tue Feb 14 00:23:58 2012 for OU Atmel Utilities Library by  doxygen 1.6.3