阈值一直用的官方给的
red_threshold = ((30, 100, 15, 127, 15, 127)) # generic_red_thresholds
green_threshold = (30, 70, -128, -20, -128, 127) # generic_green_thresholds
blue_threshold = (0, 15, 0, 40, -80, -20) # generic_blue_thresholds
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.VGA)
sensor.skip_frames(time = 3000)
sensor.set_auto_gain(False)
sensor.set_auto_whitebal(False)
clock = time.clock()
vindown()
ctr.work_mode=0x00
ctr.work_mode2=0x00
s1.pulse_width(1550)
s2.pulse_width(1650)
servo_color_flag = 0