Skip to main content

Timeline for How do you handle sensor drift?

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Aug 1, 2021 at 21:58 comment added chrisl Yes, it is redundant. The OR operator || also evaluates to true, if both operants are true. You can refer to the truth table of that operator. What you were thinking of is called exclusive OR, or shortly XOR.
Aug 1, 2021 at 21:35 comment added j0h @chrisl, is it redundant? in the event one or both potentiometers are +/- threshold value? one value may change, while the other is constant, or both may change.
Aug 1, 2021 at 15:31 comment added Edgar Bonet This approach introduces hysteresis, which is indeed a common and effective approach against this kind of problems.
Aug 1, 2021 at 8:34 comment added chrisl Note, that you can leave out the xVariance >=threshold && yVariance >= threshold part in your if statement. It is redundant. The OR operator || will also evaluate to true, if both conditions are met.
Jul 31, 2021 at 23:59 history edited j0h CC BY-SA 4.0
added 10 characters in body
Jul 31, 2021 at 23:38 history answered j0h CC BY-SA 4.0