i= 1
# Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
# The below thresholds track in general red/green things. You may wish to tune them...
thresholds = [(7, 41, 13, 37, -63, -21), #yellow generic_red_thresholds -> index is 0 so code == (1 << 0)
(55, 79, -39, 0, 8, 27),
(35, 55, 21, 84, 26, 69)] #blue generic_green_thresholds -> index is 1 so code == (1 << 1)
# 當“find_blobs”的“merge = True”時,code代碼被組合在一起。
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must be turned off for color tracking
sensor.set_auto_whitebal(False) # must be turned off for color tracking
clock = time.clock()