Add motor control with grpc

This commit is contained in:
Piv
2019-08-11 20:31:16 +09:30
parent ff98ed58d4
commit eee4e6d4de
6 changed files with 473 additions and 14 deletions

View File

@@ -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):