fixes
This commit is contained in:
parent
c7906b064c
commit
729d80b4f5
1 changed files with 12 additions and 8 deletions
|
|
@ -17,7 +17,7 @@ chiller.direction = Direction.OUTPUT
|
||||||
pump = DigitalInOut(board.D4) # Pin to control the pump
|
pump = DigitalInOut(board.D4) # Pin to control the pump
|
||||||
pump.direction = Direction.OUTPUT
|
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
|
pumpTime = 15 # How many seconds of pumping
|
||||||
|
|
||||||
|
|
@ -25,14 +25,18 @@ while True:
|
||||||
# we could also just do "led.value = not button.value" !
|
# we could also just do "led.value = not button.value" !
|
||||||
if button.value:
|
if button.value:
|
||||||
print('not')
|
print('not')
|
||||||
led.value = False
|
led.value = False # turn OFF LED
|
||||||
chiller.value = False
|
chiller.value = False # turn OFF chiller
|
||||||
pumping.value = False
|
pump.value = False # turn OFF pump
|
||||||
else:
|
else:
|
||||||
print('pressed')
|
print('pressed')
|
||||||
led.value = True
|
led.value = True # turn ON LED
|
||||||
chiller.value = True
|
chiller.value = True # turn ON chiller
|
||||||
pump.value = True
|
time.sleep(chillTime) # wait chiller time
|
||||||
time.sleep(chillTime)
|
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
|
time.sleep(0.01) # debounce delay
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue