Пример #1
0
def cam_switch(state):
    if state == 'on':
        stream.start()
    elif state == 'off':
        stream.stop()
    msg = "[PiCar-V] Stream server %s ,0.0.0.0:8080" % (state)
    print(msg)
Пример #2
0
    os.system('touch %s' % config_dir)

    import image_process
    adc = ADC(0x48)
    fw = front_wheels.Front_Wheels(db=config_dir)
    bw = back_wheels.Back_Wheels(db=config_dir)
    pan = Servo(1)
    tilt = Servo(2)
    left_wheel = bw.left_wheel
    right_wheel = bw.right_wheel

    fw.turning_max = 45
    picar.setup()
    GPIO.setmode(GPIO.BCM)

    stream.stop()

    blob_x = 0
    blob_y = 0
    blob_r = 0
    err_msg = ''
except Exception, e:
    print e
    err_msg = "PiCar-V is not avalible"


def rw_run(motor_channel, direction, speed):
    if speed < 0:
        speed = 0
    elif speed > 100:
        speed = 100