Jul-26-2018, 09:43 AM
Quote:I think that when you initialize the gpio as input it resets and either becomes low or floating so it does not retain it last status.
I think you're right.
Lets try without setting it as input:
GPIO.setup(gpio, GPIO.OUT) GPIO.output(gpio, GPIO.HIGH) print(GPIO.input(gpio)) GPIO.output(gpio, GPIO.LOW) print(GPIO.input(gpio))
Quote:I got a bit further by defining the prevpumpstat variable in datalog.py and including it in the call to pumpcontrol.
This is a more concise way to do it (IMHO). I thought that you couldn't modify the previous code.