@position.setter
    def position(self, position):
        if position > 180:
            self.logger.warning("Invalid pos {}, using 180.".format(position))
            position = 180
        elif position < 0:
            self.logger.warning(
                "Invalid position {}, using 0.".format(position))
            position = 0

        # Set duty
        self.pwm.duty = int(round(580000 + 2320000 * (position / 180.)))
        self.logger.debug("Updated {}".format(self))
Setter for servo's position as an angle.
dataset/ETHPy150Open IEEERobotics/bot/bot/hardware/servo.py/Servo.position