Home > other >  Basic tick timer stm32f103 do breathing lamp, problems
Basic tick timer stm32f103 do breathing lamp, problems

Time:09-22

I use the basic timer 32 Hal library (that is, without a pin) defines a 1 ms timing, in the main what all didn't write, then I use interrupts the callback function, into the interrupt, ten times two is high level (leds), 8 times after low level, but cannot reach a brightness (goes crazy flash), but, I write 1 ms with delay function in the main function of high low 10 milliseconds have effect, I don't know why?

CodePudding user response:

You see flickering lights crazy because of delay unit is not small enough, you use level of us just don't see flicker (actually it was a crazy flashing),

CodePudding user response:

Learn the principle of persistence of vision and breathing lamp will understand,

CodePudding user response:

TIM BASE fixed duration may be wrong, big, careful examination,

The program should be no problem

CodePudding user response:

Oscilloscope pens and a "X10", was accidentally touched, activity following a try,

CodePudding user response:

1 ms time is too long, it is best to do breathing lamp PWM mode, or the timing cycle shorter, but it's too short will be stuck, not working,

CodePudding user response:

Timer can set the interval is too short, I usually make LED lights flashing, are bright 100 milliseconds, put out 100 milliseconds, look effect is obvious,
  • Related