If then else - wrong interpretation?

https://go.particle.io/shared_apps/59b16b998465f8b84c0006b9

I have 2 Plants named “Minze” and “Feige” in a monitoring with two soil measurement sensors.
It works and the values display on my OLE Display and Serial Monitor fine.

But in the displayRead() Function the value interpretation fails with the following:

if the sensor is out of the plant (full dry) I got the information that all is “OK”.
I reckon however that with data> 80 the issue DRY would have to appear.

water1 and water2 are defined as integer - what happend here?

else if ((water1 > 30) or (water1 <= 80))

You need to AND, no OR. If the value is anything above 30 this statement will always be true.

1 Like

Oha, thx and solved with &&!

2 Likes