reversed logic

This commit is contained in:
Senad Uka
2016-04-10 12:11:54 +02:00
parent 96c67a6d00
commit 5a4fdbbd00

View File

@@ -11,7 +11,7 @@ GPIO.setup(config.GPIO_PIN_TANKFULL, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
# tank sensor has inverse logic - 0 when it is full 1 when it is not
# so we are inverting its value here
tankFull = not (GPIO.input(config.GPIO_PIN_TANKFULL) == GPIO.LOW)
tankFull = (GPIO.input(config.GPIO_PIN_TANKFULL) == GPIO.LOW)
GPIO.cleanup()
print 'Bacva puna: {}'.format(tankFull)