Add motor control with grpc
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import time
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from RPi import GPIO
|
||||
|
||||
import MotorControl.servo as servo
|
||||
|
||||
"""This module controls the Motor and Servo control.
|
||||
@@ -20,18 +18,8 @@ class Motor(servo.Servo, ABC):
|
||||
|
||||
|
||||
class MotorController(Motor):
|
||||
def __init__(self, pin_number, frequency, duty_cycle=0):
|
||||
self._duty_cycle = duty_cycle
|
||||
self._operating_frequency = frequency
|
||||
self._running = False
|
||||
self.pin_number = pin_number
|
||||
|
||||
# Operating Frequency should be 50Hz
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(self.pin_number, self._operating_frequency)
|
||||
self._control_pin = GPIO.PWM(self.pin_number, self._duty_cycle)
|
||||
|
||||
def __init__(self, pin_number, frequency):
|
||||
|
||||
|
||||
@property
|
||||
def duty_cycle(self):
|
||||
|
||||
Reference in New Issue
Block a user