RFQ/BOM 0 サインイン / 登録する

所在地を選択してください

ユーザーイメージ

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

MCU
7月 08, 2020 by West 590

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

答えを書く

返信するにはログインする必要があります。 サインイン | 登録する