chickenhouse/climate_control/heat.py
Thomas Klaehn ef2582dfa7 chickenhouse: add climate control
Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
2018-09-01 08:34:36 +02:00

20 lines
363 B
Python

try:
import gpio
except ImportError:
raise ImportError("gpio not found.")
class Heat(object):
def __init__(self, pin):
self.pin = gpio.Gpio(pin)
self.pin.export()
self.pin.direction(gpio.Gpio.DIRECTION_OUT)
self.pin.write(0)
def on(self):
self.pin.write(1)
def off(self):
self.pin.write(0)