Fixed imports and some things from first run.
This commit is contained in:
4
MotorControl/MotorServer.py
Normal file → Executable file
4
MotorControl/MotorServer.py
Normal file → Executable file
@@ -6,8 +6,8 @@ from concurrent import futures
|
||||
|
||||
import grpc
|
||||
|
||||
from . import motorService_pb2
|
||||
from . import motorService_pb2_grpc
|
||||
import motorService_pb2
|
||||
import motorService_pb2_grpc
|
||||
from MotorControl.gpiozero.motor_session import Motor
|
||||
|
||||
servo_pin = 18
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
import grpc
|
||||
|
||||
from . import motorService_pb2 as motorService__pb2
|
||||
import motorService_pb2 as motorService__pb2
|
||||
|
||||
|
||||
class CarControlStub(object):
|
||||
|
||||
Reference in New Issue
Block a user