Ejemplo n.º 1
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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)