How to create a delay function in Keil uVision?
问题 Arduino have a delay(ms) function to pause the program for certain amount of time. It is very accurate in millisecond. I have a delay function in C used in Keil uVision for AT89C5131 microp: void delay( unsigned long duration) { while ( ( duration -- )!= 0); } This does some delay job but the long value is not accurate like Arduino. Is there a way to create a function that works like delay() function in Arduino? The crystal is running at 24Mhz. Any help will be appreciated. 回答1: If you want