2016-03-20 17:16:20 +00:00
|
|
|
from gpio import gpio
|
2016-03-20 16:56:24 +00:00
|
|
|
|
|
|
|
class engine:
|
|
|
|
|
|
|
|
def __init__(self, gpio_1 = 13, gpio_2 = 19):
|
2016-03-20 17:16:20 +00:00
|
|
|
self.gpio_1 = gpio(gpio_1)
|
|
|
|
self.gpio_2 = gpio(gpio_2)
|
2016-03-20 16:56:24 +00:00
|
|
|
|
2016-03-20 17:16:20 +00:00
|
|
|
self.gpio_1.export()
|
|
|
|
self.gpio_1.direction("out")
|
|
|
|
self.gpio_2.export()
|
|
|
|
self.gpio_2.direction("out")
|
|
|
|
self.stop()
|
2016-03-20 16:56:24 +00:00
|
|
|
|
|
|
|
def stop(self):
|
2016-03-20 17:16:20 +00:00
|
|
|
self.gpio_1.set(0)
|
|
|
|
self.gpio_2.set(0)
|
|
|
|
|
|
|
|
def run_up(self):
|
|
|
|
self.gpio_1.set(1)
|
|
|
|
self.gpio_2.set(0)
|
|
|
|
|
|
|
|
def run_down(self):
|
|
|
|
self.gpio_1.set(0)
|
|
|
|
self.gpio_2.set(1)
|
|
|
|
|