/* Milli second digital delay (Input value assign by the user)*/
void DelayMS(int delayInMs) //value of delayInMs=1,2,3,.......
{
usigned long i,j;
for(i=0;i<delayInMs;i++)
for(j=0;j<6024;j++);
} //End of function
void main()
{
DelayMs(500);//generate delay of 500 ms
}
Common Programming Errors:-
Sometime programmer started with main and give the definition of function after that. its shows error to avoid that you can write only function name before main and define after main.
Good Programming Practice:-
Use uppercase letter for function name and you can use underscore( _ ) sign also.
No comments:
Post a Comment