RFQ/BOM 0 登錄 / 註冊

選擇您的位置

用戶形象

How to compare the voltage results collected by the MCU twice?

MCU
7月 08, 2020 by West 605

I would like to ask, if the voltage collected by the microcontroller for the first time is 1.77v, and the second collection is carried out after ten minutes, the collected voltage is 1.76v, the single chip can collect the voltage collected for the second time and the first collection To compare the voltage? (The second collected voltage is greater than the last collected voltage is calculated as 1, the second collected voltage is less than the first collected voltage is calculated as 0) Then by analogy, each collected voltage is equal to Compare the voltage collected last time, and compare the results. I hope to see the great god can help me, grateful!

所有評論

user image

Shelley 發表於 July 8, 2020

Set two buffers, one comparison result flag

The last put in buf[0], the latest put in buf[1]

Compare the relationship between buf[0] and buf[1] according to your logic, whether the flag is 1 or 0

Then set buf[0] = buf[1]; to wait for the next comparison.

0
  • West

    West 發表於 July 8, 2020

    Thanks for your help, so I know how to communicate with the engineer, thank you very much.

  • 您需要登錄才能回覆。 登錄 | 註冊

user image

Mayer 發表於 July 8, 2020

If you don't need to save it after power-off, you can use the variable to save and compare and replace.

0

寫一個答案

您需要登錄才能回覆。 登錄 | 註冊