Page 1 of 1

Counter on Function

PostPosted: Wed Apr 08, 2020 5:46 pm
by Donovan CR6
Hi Guys
Is there a way to use a counter on a function?
So basically I want to have 3 different aircon temperature settings, I currently have one setting using hysteresis coming on at 6degrees and off a 1 degree. I want a low, medium and high with different temp settings but how do I put a counter on this? Seems like the counter only works with an output and not a function?

Re: Counter on Function

PostPosted: Thu Apr 09, 2020 2:40 am
by David Ferguson
I have implemented a several functions using counters. Such as
Wiper Speed = Counter(range:0..2, increment:Wiper Speed Button, edge=rising, wrap=true)
Display Brightness = Counter(range:1..4,increment:Display Brightness Button, edge=rising, wrap=true,override:Master Shutdown Switch, constant=4)

I then use this channels in other functions such as:
Wiper Switch.intermittent = (Wiper On Req = true) and (Wiper Speed = 0)
Wiper Switch.slow = (Wiper On Req = true) and (Wiper Speed = 1)
Wiper Switch.fast = (Wiper On Req = true) and (Wiper Speed = 2)


These Switch functions are then used in the various output conditions
so the low speed wiper output condition would be
Wiper Switch.slow or Wiper.Intermittent.Speed (<- this is function that uses flash())

Hopefully that example is enough to get you going. if not, post your config and I'll see if we can help directly.