# Path: minibot/hardware/gpio.py
# class PWM():
#     """
#     PWM used on a minibot.
#     """
#     def __init__(self, pin, frequency, duty_cycle=0):
#         """
#         Constructor.
#         Args:
#             pin (int): Pin that the PWM is connected to on the minibot.
#             frequency (int): Frequency of the PWM.
#             duty_cycle (int): Duty cycle of the PWM.
#         """
#         self.pin = pin
#         self.frequency = frequency
#         self.duty_cycle = duty_cycle
# 
#     def set_frequency(self, frequency):
#         """
#         Sets frequency of the PWM.
#         """
#         self.frequency = frequency
# 
#     def set_duty_cycle(self, duty_cycle):
#         """
#         Sets duty cycle of the PWM.
#         """
#         self.duty_cycle = duty_cycle
# 
#     def stop(self):
#         """
#         Stops the PWM.
#         """
#         raise NotImplementedError("PWM.stop")
# 
# Path: minibot/hardware/gpio.py
# class DigitalInput():
#     """
#     Digital input pin.
#     """
#     def __init__(self, pin):
#         """
#         Constructor.
#         Args:
#             pin (int): Digital pin number.
#         """
#         self.pin = pin
# 
#     def read(self):
#         """
#         Read input from the digital pin.
#         Return:
#             int: 0 or 1 for LOW or HIGH voltage.
#         """
#         raise NotImplementedError
# 
# Path: minibot/hardware/gpio.py
# class DigitalOutput():
#     """
#     Digital output pin.
#     """
#     def __init__(self, pin):
#         """
#         Constructor.
#         Args:
#             pin (int): Digital pin number.
#         """
#         self.pin = pin
# 
#     def set_low(self):
#         """
#         Set the digital output pin to low.
#         """
#         raise NotImplementedError
# 
#     def set_high(self):
#         """
#         Set the digital output pin to high.
#         """
#         raise NotImplementedError


from minibot.hardware.gpio import PWM as MPWM
from minibot.hardware.gpio import DigitalInput as MDigitalInput
from minibot.hardware.gpio import DigitalOutput as MDigitalOutput
import RPi.GPIO as RGPIO
    Digital output pin.
    """
    def __init__(self, pin):
        MDigitalOutput.__init__(self, pin)
        RGPIO.setup(pin, RGPIO.OUT)

    def set_low(self):
        """
        Set the digital output pin to low.
        """
        RGPIO.output(self.pin, RGPIO.LOW)

    def set_high(self):
        """
        Set the digital output pin to high.
        """
        RGPIO.output(self.pin, RGPIO.HIGH)

class PWM(MPWM):
    """
    PWM for MiniBot used for RPi. Inherits from general PWM class.
    """
    def __init__(self, pin, frequency=1, duty_cycle=0):
        """
        Constructor.
        Args:
            pin (int): pin used for minibot.
            frequency (int):  frequency used for minibot's PWM.
            duty_cycle (float): duty cycle of minibot's PWM (0 to 1).
        """

# Path: minibot/hardware/gpio.py
# class PWM():
#     """
#     PWM used on a minibot.
#     """
#     def __init__(self, pin, frequency, duty_cycle=0):
#         """
#         Constructor.
#         Args:
#             pin (int): Pin that the PWM is connected to on the minibot.
#             frequency (int): Frequency of the PWM.
#             duty_cycle (int): Duty cycle of the PWM.
#         """
#         self.pin = pin
#         self.frequency = frequency
#         self.duty_cycle = duty_cycle
# 
#     def set_frequency(self, frequency):
#         """
#         Sets frequency of the PWM.
#         """
#         self.frequency = frequency
# 
#     def set_duty_cycle(self, duty_cycle):
#         """
#         Sets duty cycle of the PWM.
#         """
#         self.duty_cycle = duty_cycle
# 
#     def stop(self):
#         """
#         Stops the PWM.
#         """
#         raise NotImplementedError("PWM.stop")
# 
# Path: minibot/hardware/gpio.py
# class DigitalInput():
#     """
#     Digital input pin.
#     """
#     def __init__(self, pin):
#         """
#         Constructor.
#         Args:
#             pin (int): Digital pin number.
#         """
#         self.pin = pin
# 
#     def read(self):
#         """
#         Read input from the digital pin.
#         Return:
#             int: 0 or 1 for LOW or HIGH voltage.
#         """
#         raise NotImplementedError
# 
# Path: minibot/hardware/gpio.py
# class DigitalOutput():
#     """
#     Digital output pin.
#     """
#     def __init__(self, pin):
#         """
#         Constructor.
#         Args:
#             pin (int): Digital pin number.
#         """
#         self.pin = pin
# 
#     def set_low(self):
#         """
#         Set the digital output pin to low.
#         """
#         raise NotImplementedError
# 
#     def set_high(self):
#         """
#         Set the digital output pin to high.
#         """
#         raise NotImplementedError


# Path: minibot/hardware/rpi/gpio.py
from minibot.hardware.gpio import PWM as MPWM
from minibot.hardware.gpio import DigitalInput as MDigitalInput
from minibot.hardware.gpio import DigitalOutput as MDigitalOutput
import RPi.GPIO as RGPIO

    Digital output pin.
    """
    def __init__(self, pin):
        MDigitalOutput.__init__(self, pin)
        RGPIO.setup(pin, RGPIO.OUT)

    def set_low(self):
        """
        Set the digital output pin to low.
        """
        RGPIO.output(self.pin, RGPIO.LOW)

    def set_high(self):
        """
        Set the digital output pin to high.
        """
        RGPIO.output(self.pin, RGPIO.HIGH)

class PWM(MPWM):
    """
    PWM for MiniBot used for RPi. Inherits from general PWM class.
    """
    def __init__(self, pin, frequency=1, duty_cycle=0):
        """
        Constructor.
        Args:
            pin (int): pin used for minibot.
            frequency (int):  frequency used for minibot's PWM.
            duty_cycle (float): duty cycle of minibot's PWM (0 to 1).
        """

        MPWM.__init__(self, pin, frequency, duty_cycle)