Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Single chip microcomputer delay program
Single chip microcomputer delay program
When you call the delay function, the entry parameter of the function, ... delay ms (10); ... the purpose is to delay 10ms, which is the unsigned plastic variable xms of this uint, so it is assigned to 10, after inputting delaymas (); After the function, i=xms, that is, i= 10, and then make a for loop to make the corresponding time delay according to the clock cycle of the system. Without xms, your delay function can only be written as a fixed delay, which means it is not convenient to determine the value of internal I of delayms. With the entry parameters, you can delay at will as mentioned above (the numerical range should be within the definition of uint, that is, less than 65536).