This commit is contained in:
John Edgar Park 2017-10-31 16:48:09 -07:00
parent c7906b064c
commit 729d80b4f5

View file

@ -17,7 +17,7 @@ chiller.direction = Direction.OUTPUT
pump = DigitalInOut(board.D4) # Pin to control the pump
pump.direction = Direction.OUTPUT
chillTime = 10 # How many seconds of cooling
chillTime = 60 # How many seconds of cooling
pumpTime = 15 # How many seconds of pumping
@ -25,14 +25,18 @@ while True:
# we could also just do "led.value = not button.value" !
if button.value:
print('not')
led.value = False
chiller.value = False
pumping.value = False
led.value = False # turn OFF LED
chiller.value = False # turn OFF chiller
pump.value = False # turn OFF pump
else:
print('pressed')
led.value = True
chiller.value = True
pump.value = True
time.sleep(chillTime)
led.value = True # turn ON LED
chiller.value = True # turn ON chiller
time.sleep(chillTime) # wait chiller time
chiller.value = False # turn OFF chiller
pump.value = True # turn ON pump
time.sleep(pumpTime) # wait pump time
pump.value = False # turn OFF pump
led.value = False # turn OFF LED
time.sleep(0.01) # debounce delay