C Language Development Kit/Functions/Delay
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/delay)
| Description | This function waits for a time specified by the argument time. The time is specified in steps of 20 milliseconds. For example, time = 50 will cause a delay of 20*50 = 1000 milliseconds. |
| Syntax | void delay(int time); |
| Arguments | The time is specified in steps of 20 milliseconds.
int time |
| Returns | None |
| Remarks | This function automatically calls the idle() function in order to reduce the power consumption. |
| Example | #include "lib.h" #include <stdio.h> void main( void ) { while( 1 ) { printf("Hello world."); delay( 100 ); // show the message on the screen for 2 seconds printf("\f"); delay( 100 ); } } |
