示例#1
0
def rd_snr():
    snr = direct_command.DirectCommand()
    snr.add_input_device_ready_raw3(1, 4, 29)
    with ev3.EV3() as brick:
        x = snr.send(brick)
        print x[0]
        return x[0]
示例#2
0
            def execute_dc(*args):
                """This is just a wrapper around an individual DirectCommand
                method. See the DirectCommand class for more information.

                """
                dc = direct_command.DirectCommand()
                getattr(dc, dc_name)(*args)
                return dc.send(self)
示例#3
0
def rd_snr():
    snr = direct_command.DirectCommand()
    snr.add_input_device_ready_si(0, 0, 33)
    snr.add_input_device_ready_si(1, 2, 29)
    snr.add_input_device_get_bumps(3)
    with ev3.EV3() as brick:
        x = snr.send(brick)
        print x
        return x
示例#4
0
def mv_rbt(direction, turn_ratio, step):
    mv = direct_command.DirectCommand()
    mv.add_output_ready(direct_command.OutputPort.PORT_C
                        | direct_command.OutputPort.PORT_B)
    mv.add_output_step_sync(
        direct_command.OutputPort.PORT_C | direct_command.OutputPort.PORT_B,
        direction, turn_ratio, step, 1)
    with ev3.EV3() as brick:
        mv.send(brick)
示例#5
0
def LEDs(pattern):
    LED = direct_command.DirectCommand()
    LED.add_set_leds(pattern)
    with ev3.EV3() as brick:
        LED.send(brick)
示例#6
0
def rst_tch():
    chk2 = direct_command.DirectCommand()
    chk2.add_input_device_clr_all(3)
    with ev3.EV3() as brick:
        chk2.send(brick)
示例#7
0
def stop_rbt():
    stop = direct_command.DirectCommand()
    stop.add_output_stop(
        direct_command.OutputPort.PORT_C | direct_command.OutputPort.PORT_B, 1)
    with ev3.EV3() as brick:
        stop.send(brick)