Author Topic: How do I detect a temperature drop on a sensor. In Pleg?  (Read 117 times)

Offline Biksbj

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
How do I detect a temperature drop on a sensor. In Pleg?
« on: October 04, 2018, 09:33:18 am »
I have something I have to stop if there is a temperature drop on one and the same sensor.
I can not figure out how to save the sensor value so I can use this and see if it's higher than current value.
Please help me, I've tried everything I've been able to figure out.

Offline kigmatzomat

  • Sr. Member
  • ****
  • Posts: 353
  • Karma: +21/-0
Re: How do I detect a temperature drop on a sensor. In Pleg?
« Reply #1 on: October 07, 2018, 08:47:31 pm »
I have not tried this and there may be something more elegant.

Use the STATE variable to define a sequence (a,b,a,b,a,b....)

Store the current temp to A or B as the state flips
Atemp:   When state=a then temp
Btemp: when state=b then temp

Tempdrop
If(state=a and Btemp>Atemp) or (stat=b and Atemp>Btemp)


Again, haven't tried it but at first blush it should work.