This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于PICCOLO F28035采样问题



大家好,我程序中有两个个中断,时间 一为50K 二为100K,而采样触发频率为100K。我想把连续采样的两次结果平均后,再放入中断一中去计算。程序如何写呢?谢谢大家指点了。

  • 您好,

    可以定义一个标志变量;在中断二中进行判断,每进入两次该中断,对标志变量进行赋值;在中断一中根据标志变量的值判断是否完成了两次采样,如果完成则进行平均计算,并将标志变量还原;如果未完成两次采样,则继续等待。