Checking previous rates in conditional function

hey there,

Due to the quality of my pH and EC sensors, fluctuations happen over time, and even though there is a slight chance of catching the wrong moment to take action (either pumping acid or base), it happens. Therefore, I was wondering whether I could track the number of consecutive rates of pH and EC and be able to step in. Say the last five rates were under the condition.

Conditional Functions now have an Initialization section to more easily add code to initialize variables.

Initialize Code:

self.list_past_ph_measurements = []

Then, in your Run Code:

measurement = self.condition("asdf1234")
# code to add measurement to self.list_past_ph_measurements
# code to respond based on contents of self.list_past_ph_measurements 
1 Like