aa146b15e5
Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
25 lines
577 B
Python
25 lines
577 B
Python
import gpio
|
|
|
|
class Engine(object):
|
|
def __init__(self, gpio_1 = 13, gpio_2 = 19):
|
|
self.gpio_1 = gpio.Gpio(gpio_1)
|
|
self.gpio_2 = gpio.Gpio(gpio_2)
|
|
|
|
self.gpio_1.export()
|
|
self.gpio_1.direction(gpio.Gpio.DIRECTION_OUT)
|
|
self.gpio_2.export()
|
|
self.gpio_2.direction(gpio.Gpio.DIRECTION_OUT)
|
|
self.stop()
|
|
|
|
def stop(self):
|
|
self.gpio_1.set(0)
|
|
self.gpio_2.set(0)
|
|
|
|
def up(self):
|
|
self.gpio_1.set(1)
|
|
self.gpio_2.set(0)
|
|
|
|
def down(self):
|
|
self.gpio_1.set(0)
|
|
self.gpio_2.set(1)
|