Vweber Posted October 11, 2016 Share Posted October 11, 2016 I need a script that turns on pump, P1 when atemperature sensor T1 is 10 degrees greator than temperature sensor T2 and keeps P1 running until temperature sensor T1 is less than 5 degrees greator than T2. i have tried: while (1) if ((T1 - T2 >= 10) && (T1 -T2 >= 10)) P1 = 1 endif if ((T1 - T2 <= 5 ) && (T1 -T2 <= 5)) P1 = 0 endif endwhile this just turns the pump on and off once per second or so while 10 degree threshold is met. have tried a few other iterations, but it justdoes not seem to like the variable sum on readings taken every second. any help is appreciated! vic Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.