RFQ/BOM 0 Anmelden / Registrieren

Wähle deinen Standort

Benutzerbild

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

MCU
Juli 08, 2020 by West 603

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!

Alle Kommentare

user image

Shelley Veröffentlicht am 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 Veröffentlicht am July 8, 2020

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

  • Sie müssen sich anmelden, um antworten zu können. Anmelden | Registrieren

user image

Mayer Veröffentlicht am 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

Schreiben Sie eine Antwort

Sie müssen sich anmelden, um antworten zu können. Anmelden | Registrieren