FIxed graphs / inverted the tankFull bit!

This commit is contained in:
Senad Uka
2016-04-09 07:11:08 +02:00
parent 974f18e067
commit c947980844
4 changed files with 57 additions and 28 deletions

View File

@@ -8,7 +8,10 @@ import RPi.GPIO as GPIO
# Try to read the state of GPIO_PIN_TANKFULL
GPIO.setmode(GPIO.BCM)
GPIO.setup(config.GPIO_PIN_TANKFULL, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
tankFull = GPIO.input(config.GPIO_PIN_TANKFULL)
# tank sensor has inverse logic - 0 when it is full 1 when it is not
# so we are inverting its value here
tankFull = !GPIO.input(config.GPIO_PIN_TANKFULL)
GPIO.cleanup()
print 'Bacva puna: {}'.format(tankFull)