Feb-10-2017, 07:01 PM
I have a dht22 temp/humidity sensor and I am looking for help on how to create a value system within the sensor reading. Currently I have a fan turning on if the reading is greater than a certain temp or humidity with if-elif-else statements. But I am looking to create a value system where I could set point values for example; t = temp, h = humidity, p = points, v = value. if t = 80 then p = .1, if t = 81 then p = .2 (and so on), if h = 40 then v = .1, if h = 50 v = .2 (and so ). Then I am looking to code a similar system with if-elif-else statements to say "if (p + v) > 1: (Turn fans on), else: (do nothing).
I am just looking for some advice on what function would be the best solution because if-elif-else doesn't seem to be the right fit and I'm not too familiar with variables and such.
I have a rpi 3. Thank You!
I am just looking for some advice on what function would be the best solution because if-elif-else doesn't seem to be the right fit and I'm not too familiar with variables and such.
I have a rpi 3. Thank You!