Traditional Culture Encyclopedia - Photography major - Zero-based popular science STM32L053 single chip microcomputer, and its programming-use uVision5 to make a program to make LED lights on.

Zero-based popular science STM32L053 single chip microcomputer, and its programming-use uVision5 to make a program to make LED lights on.

Idea: Control an LED light, with pull-up mode, pin high light off and pin low light on. This LED uses the same P-port pin, assuming that it is P- 1.0-P- 1 of P-port, and it is painted with * * * pin. In the software, you only need to use the for loop for these lights. Code # contains? Not signed? Charles? PData// records the current status, with the value of 1 indicator light, and takes the inverse//delay when outputting to the P port. This function is imprecise in terms of delay. If accurate delay is needed, the number of invalid cycles after accurate calculation needs to be adjusted according to the assembly statement of this function. Delay (unsigned? int? Ms){ unsigned? Charles? Me; ? while(ms-){ for(I = 0; I'm < 120; t++){? ; } ? }} void? main(){? Not signed? Charles? I = 0; ? PData = 0x00// state of complete extinction? While( 1){// What is the on-off state of the infinite loop? (I = 0; I & ltok;; I++){// The cycle from the lowest bit to the highest bit is not always on? P 1 =~(PData+ ( 1