Add output pin inversion, update docs.

This commit is contained in:
Steve
2024-08-20 22:34:29 -06:00
parent 42d391ce4e
commit d3b10d29b0
6 changed files with 33 additions and 19 deletions
+5 -2
View File
@@ -36,19 +36,22 @@ class Output(object):
state relay to turn the kiln elements on and off.
inputs
config.gpio_heat
config.gpio_heat_invert
'''
def __init__(self):
self.active = False
self.heater = digitalio.DigitalInOut(config.gpio_heat)
self.heater.direction = digitalio.Direction.OUTPUT
self.off = config.gpio_heat_invert
self.on = not self.off
def heat(self,sleepfor):
self.heater.value = True
self.heater.value = self.on
time.sleep(sleepfor)
def cool(self,sleepfor):
'''no active cooling, so sleep'''
self.heater.value = False
self.heater.value = self.off
time.sleep(sleepfor)
# wrapper for blinka board