Can someone help me understand this code from a BME280 humidity
sensor. I am interested in how the ? (question mark) and : (colon)
is used, and how it changes or modifies var1.
link to the documentation of the conditional operator (colloquially referred to as ternary operator or condition) for whoever would end up reading this post in the future
// checks the boolean value of the first expression (a) and,
// depending on the resulting value, evaluates and returns
// either the second (b) or the third (c) expression
a ? b : c;