karotto:
Hi. I want to say the following:
if x ! (<70 && >5)
digitalWrite (LED, HIGH);in words: I want LED to light if x is not between 5 and 70. I do need to use the "not" function because if I use a function like if x >70 || x <5 I do not get the LED to light if x = nan (like my temperature sensor got disconnected)
Thanks much
The entire expression must be within the parenthesis and your syntax is incorrect. But your premise is not entirely correct because every such expression has a complement that can be expressed without the negation:
if (not (x <70 && x>5) )
can be:
if (x >= 70 || x <= 5)
How a failed reading is reported depends on the sensor library code.
Also "!" is not a function, it is an operator.