Ejemplo n.º 1
0
def turn_points_90():
    shared_all.move_straight(distance_mm=90, speed_mm_s=140)
    shared_all.turn(110, 190)
    wait(2000)
    shared_all.turn(-110, 190)
    wait(2000)
    shared_all.turn(90)

    wait(3000)
    shared_all.turn(-90)


#BUtton 1: Rev arc 90  BUt 2:
while True:
    buttons = shared_all.any_button_pressed()

    shared_all.log_string('Button pressed ' + str(buttons))
    if Button.UP in buttons:  ## but 1
        turn_arc_rev_90()
    if Button.RIGHT in buttons:  ## but 2
        turn_arc_90()
    if Button.DOWN in buttons:  ## but 3
        turn_smallarc_90()
    if Button.LEFT in buttons:  ## but 4
        turn_points_90()
    if Button.CENTER in buttons:  ## but 5
        turn_arc_rev_90()
        turn_arc_90()
        turn_smallarc_90()
        turn_points_90()
Ejemplo n.º 2
0
    slide.runfacing()


def bocciarun():
    shared_all.calibrate_gyro(-45)
    boccia.align()
    boccia.run()
    
def lastbow():
    shared_all.calibrate_gyro(0)
    bus_service_1.base_to_stepcounter()
    stepcounter.run()


while True:
    buttons = shared_all.any_button_pressed()

    shared_all.log_string('Button pressed ' + str(buttons))
    if  Button.UP in buttons: ## BUT 1
        bocciarun()
    if Button.RIGHT in buttons: ## BUT 2
        benchrun()
    if  Button.DOWN in buttons: ## BUT 3
        innov_basket()
    if Button.LEFT in buttons: ## button 4
        sliderun()

    if Button.CENTER in buttons: ## button center
        buttons = shared_all.any_button_pressed(waiting_color=Color.YELLOW)

        if  Button.UP in buttons: ## BUT 1
Ejemplo n.º 3
0
def bench_to_loading():
    shared_all.move_straight(distance_mm=200, speed_mm_s=-140)
    shared_all.move_crane_to_top(crane_motor)
    shared_all.move_crane_down(crane_motor, 20)
    shared_all.sound_alarm()
    shared_all.any_button_pressed()