Make it more clear how the pins/pin software used is working.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import os
|
||||
from gpiozero import Servo
|
||||
from gpiozero import Servo, Device
|
||||
|
||||
GPIOZERO_PIN_FACTORY = "piggpio"
|
||||
|
||||
class Motor:
|
||||
def __init__(self, motor_pin=19):
|
||||
# This may not work properly, should print.
|
||||
os.environ["GPIOZERO_PIN_FACTORY"] = GPIOZERO_PIN_FACTORY
|
||||
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")
|
||||
self.set_motor_pin(motor_pin)
|
||||
self.initialise_motor()
|
||||
|
||||
Reference in New Issue
Block a user