Ejemplo n.º 1
0
        elif input_servo == "l":
            servo = Servo(config.linear_pin, 180)
            servo.start(10, 5)
            servo.update_duty(10)
            duty = 10
            break
        #   pulley servo:
        #    stop: 0, 100
        #    ccw: [2.17 - 7.23] (fast - slow) extend blade
        #    cw: [7.55 - 12.59] (slow - fast) retract blade
        elif input_servo == "p":
            servo = Servo(config.pulley_pin, 180)
            servo.start(0, 8)
            servo.update_duty(0)
            duty = 0
            break
        else:
            print("Error: Try again")
            continue

    # confirming power
    input("Press any key after motors are connected to power")

    main(duty)

    print("\nClosing Program")
    servo.cleanup()
    home_switch.cleanup()  # NEVER DELETE
    end_switch.cleanup()  # NEVER DELETE
    slide.cleanup()