4646c7d7a6
Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
30 lines
624 B
Python
30 lines
624 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.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)
|