16931c50ba
Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
30 lines
636 B
Python
30 lines
636 B
Python
'''
|
|
Created on Mar 30, 2017
|
|
|
|
@author: tkla
|
|
'''
|
|
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.write(0)
|
|
self.gpio_2.write(0)
|
|
|
|
def up(self):
|
|
self.gpio_1.write(1)
|
|
self.gpio_2.write(0)
|
|
|
|
def down(self):
|
|
self.gpio_1.write(0)
|
|
self.gpio_2.write(1)
|