delay time coding make me puzzled. for example: void delay() { int x=20000; do{x=x-1;}while(x>1); } how to understand it's delay.and how long time??? sincere your in advance!
Please read the instructions immediately above where you typed-in your question - they tell you what to do when posting code. Also see the tips for posting messages: http://www.keil.com/forum/tips.asp When you follow the instructions, your code will retain its formatting, like this:
void delay() { int x=20000; do { x=x-1; } while(x>1); }
wo will try it. thanks for all your help !! Best regards
delay routines should never be written in C they may cange when the compiler is revised. Erik
delay routines should never be written in C Or, to elaborate, delay routines that rely on a processor busy-loop and require precision based on counting instruction cycles are at some degree of risk. Feel free to write delay routines that read a hardware timer in C.