def initialize_output_pins(self): """ Initializes the pins as output and set the energy to low. """ for pin in self.output_pins: GPIO.setup(pin, GPIO.OUT) GPIO.output(pin, GPIO.LOW)
def stop(cls, output_pins, steps): """ Stops the panel axis' movements Arguments: output_pins {list} -- List with the output pins """ for pin in output_pins: GPIO.output(pin, GPIO.LOW) logger.info("Stopped the movements")
def right(cls, output_pins, steps): """ Rotate the panels clockwise Arguments: output_pins {list} -- List of output pins steps {list} -- 2D list of the steps """ for halfstep in range(len(steps)): for pin in range(len(output_pins)): GPIO.output(output_pins[pin], steps[halfstep][pin]) time.sleep(0.001) logger.info("Turning the panels to the right")
def left(cls, output_pins, steps): """ Rotates the panels anti-clockwise. Arguments: output_pins {list} -- List of output pins steps {list} -- 2D list of the steps """ for halfstep in reversed(range(len(steps))): for pin in range(len(output_pins)): GPIO.output(output_pins[pin], steps[halfstep][pin]) time.sleep(0.001) logger.info("Turning the panels to the left")
def right(cls, output_pins): """ Moves backward, turning the panels to the right """ for pin_pairs in output_pins: GPIO.output(pin_pairs[0], GPIO.LOW) GPIO.output(pin_pairs[1], GPIO.HIGH) return logger.info("Turning the panels to the right")
def left(cls, output_pins): """ Moves forward, turning the panels to the left""" for pin_pairs in output_pins: GPIO.output(pin_pairs[0], GPIO.HIGH) GPIO.output(pin_pairs[1], GPIO.LOW) return logger.info("Turning the panels to the left")
def stop(cls, output_pins): """ Stops the actuator. """ for pin_pairs in output_pins: GPIO.output(pin_pairs[0], GPIO.LOW) GPIO.output(pin_pairs[1], GPIO.LOW) return logger.info("Stopped the movements")
def initialize_output_pins(self): """ initializes the output pins to low """ for pins in self.output_pins: GPIO.output(pins[0], GPIO.LOW) GPIO.output(pins[1], GPIO.LOW)