def speedcontrol_test():
    '''
    #thread_encoder = threading.Thread(target = encoder.start_encoder,args = ())
    thread_motor = threading.Thread(target = motor.test_motor,args = ())
    thread_standstill = threading.Thread(target = standstill,args = ())
    #thread_encoder.start()
    thread_motor.start()
    thread_standstill.start()
    '''
    SPEED = 0
    DIRECTION = 0

    motor.init_motor(500)
    motor.stop()
    standstill()
Beispiel #2
0
##camera.shutter_speed = 800      #快门速度
##camera.exposure_compensation = 25
##camera.ISO = 1300
##camera.exposure_mode = 'sports'

##camera.awb_mode = 'fluorescent'

cap = cv2.VideoCapture(0)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 240)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 320)

##stream = io.BytesIO()
##camera.close()

#初始化电机
motor.init_motor(500)
motor.stop()
motor.car_run_flag = 1

#初始化红外
##motor.init_IR()

##beep.initial_beep()
##num = 0
##while True:
##    ret,c_img = cap.read()
##    num += 1
##    if(num>100):
##        break

##beep.beep_once()
def speedcontrol_test():
    motor.init_motor(500)
    motor.stop()
    ##    motor.set_car_run(1,100,0)
    ##    time.sleep(4)
    standstill(15, 1000)