tidy up motor_session, initialise pigpiod
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import os
|
||||
from gpiozero import Servo, Device
|
||||
from gpiozero.pins.pigpio import PiGPIOFactory
|
||||
|
||||
GPIOZERO_PIN_FACTORY = "piggpio"
|
||||
import subprocess
|
||||
|
||||
class Motor:
|
||||
def __init__(self, motor_pin=19):
|
||||
# This may not work properly, should print.
|
||||
subprocess.call(['sudo', 'pigpiod'])
|
||||
Device.pin_factory = PiGPIOFactory()
|
||||
print('Using pin factory:')
|
||||
print(Device.pin_factory)
|
||||
|
||||
Reference in New Issue
Block a user