예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)