I am having trouble figuring out the logic for what I am trying to do. I have accomplished what I wanted using interrupt pins, but am now trying to do the same programmatically since the end product would require 10+ interrupt pins.
I am using 4 DHT11s and 4 fans. Essentially I want set a humidity threshold value, and if one of the DHTs reads above that value, I want to turn on the "touching fans" until the humidity falls below the threshold, then run the "touching fans" for 15 minutes.
*touching fans* if dht1 > threshold , fan 1 and 2 turn on if dht2 > threshold, fan 1 2 and 3 turn on if dht3 > threshold, fan 2 3 4 turn on if dht4 > threshold, fan 3 4 turn on
The part that I am having issues with is...
If dht1 goes above the threshold, fans 1 and 2 turn on high. dht1 falls below the threshold, so fan 1 and 2 begin a 15 minute cycle on low. During this cycle, if dht3 goes about the threshold, now fan1 should continue the cycle on low, but fans 2 3 and 4 should now run on high.
Any guidance would be GREATLY appreciated!