def clkwise_D(): global left_have, right_have if left_have == "Y": motor.posi_unit("left", 1) elif right_have == "Y": motor.posi_unit("right", 1) else: own, deg, dir = decide("Y") if own == 0: left_have = "Y" motor.posi_group("right", deg) motor.posi_unit("left", 1) else: right_have = "Y" motor.posi_group("left", deg) motor.posi_unit("right", 1)
def clk_U2(): global left_have, right_have if left_have == "W": motor.posi_unit("left", 2) elif right_have == "W": motor.posi_unit("right", 2) else: own, deg, dir = decide("W") #decide which data!! if own == 0: left_have = "W" motor.posi_group("right", deg) motor.posi_unit("left", 2) else: right_have = "W" motor.posi_group("left", deg) motor.posi_unit("right", 2)
def clk_F2(): global left_have, right_have if left_have == "B": motor.posi_unit("left", 2) elif right_have == "B": motor.posi_unit("right", 2) else: own, deg, dir = decide("B") if own == 0: left_have = "B" motor.posi_group("right", deg) motor.posi_unit("left", 2) else: right_have = "B" motor.posi_group("left", deg) motor.posi_unit("right", 2)
def anticlk_U(): global left_have, right_have if left_have == "W": motor.nega_unit("left", 1) elif right_have == "W": motor.nega_unit("right", 1) else: own, deg, dir = decide("W") if own == 0: left_have = "W" motor.posi_group("right", deg) motor.nega_unit("left", 1) else: right_have = "W" motor.posi_group("left", deg) motor.nega_unit("right", 1)