Fixed imports and some things from first run.

This commit is contained in:
Michael Pivato
2019-09-29 18:58:17 +09:30
parent 78ba890669
commit 1feb8c235e
3 changed files with 7 additions and 8 deletions

View File

@@ -8,9 +8,8 @@ class Motor:
def __init__(self, motor_pin=19):
# This may not work properly, should print.
Device.pin_factory = PiGPIOFactory()
print('Using pin factory: ' + Device.pin_factory)
# This will say it fails if pigpio daemon is already started, just ignore it.
os.system("sudo pigpiod")
print('Using pin factory:')
print(Device.pin_factory)
self.set_motor_pin(motor_pin)
self.initialise_motor()
@@ -43,4 +42,4 @@ class Motor:
return False
def stop(self):
self.set_throttle(0)
self.set_throttle(0)