27 lines
453 B
Python
27 lines
453 B
Python
from gpio import gpio
|
|
|
|
class engine:
|
|
|
|
def __init__(self, gpio_1 = 13, gpio_2 = 19):
|
|
self.gpio_1 = gpio(gpio_1)
|
|
self.gpio_2 = gpio(gpio_2)
|
|
|
|
self.gpio_1.export()
|
|
self.gpio_1.direction("out")
|
|
self.gpio_2.export()
|
|
self.gpio_2.direction("out")
|
|
self.stop()
|
|
|
|
def stop(self):
|
|
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)
|
|
|