chickenhouse/engine.py

28 lines
613 B
Python
Raw Normal View History

2016-03-20 16:56:24 +00:00
class engine:
def __init__(self, gpio_1 = 13, gpio_2 = 19):
self.gpio_1 = gpio_1
self.gpio_2 = gpio_2
# export gpio's
n = "/sys/class/gpio/gpio" + str(self.gpio_1)
if not islink(n):
f = open("sys/class/gpio/export", "w")
f.write(str(self.gpio_1)
f = open("sys/class/gpio/gpio" + str(self.gpio_1) +\
"/value", "w")
f.write("out")
n = "/sys/class/gpio/gpio" + str(self.gpio_2)
if not islink(n):
f = open("sys/class/gpio/export", "w")
f.write(str(self.gpio_2)
f = open("sys/class/gpio/gpio" + str(self.gpio_2) +\
"/value", "w")
f.write("out")
def stop(self):