2621| 4
|
pwm发一定数量的脉冲 |
1金钱
最佳答案首先,break对if-else不起作用,运行到break时直接跳出while(1)循环。
故,while(1)只执行了10个循环,大约10*10=100us,这100us时间内产生的效果不知道你是通过什么观测的,仿真的话能看到持续100us的PWM波形,而你的PWM频率是20ms,100us连PWM的一个周期都不到,所以你肯定观测不到你要的PWM脉冲。如果你是用LED观测的话,看不到任何现象,估计连山都不闪一下。
另外,题主大概是想通过延时控输出脉冲数,参考思路:开启 ...
| ||
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
我有故事,你有酒吗
|
||
| ||
|手机版|OpenEdv-开源电子网
( 粤ICP备12000418号-1 )
GMT+8, 2025-7-22 06:11
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网