Your Delay function looks OK as far as it goes -- it delays for 10usec (actually more like 20us) for each count (Delay(5)->(5*10usec) delay.) Is that what you intended? It's less clear to me what the program overall is trying to do. Are you trying to drive a DC motor using PWM?
↧