A
initAI('后')
setMode('颜色识别')
state = '空'
while True:
followLine()
if state == '空':
if isAllBlack():
enter()
goods = detectColor()
if goods == '红' or goods == '蓝':
setClaw(1)
state = '满'
if state == '满':
color = getColor() - 1
if color == goods:
enter()
setClaw(0)
state = '空'
B
initAI()
setMode('人脸识别')
state = 0
while True:
followLine()
if state == 0:
if isAllBlack():
enter()
goods = detectColor()
if goods == '红':
setClaw(1)
state = 1
if state == 1:
color = getColor()
if color == goods:
enter()
setClaw(0)
state = 0
C
initAI('后')
setMode('颜色识别')
state = '空'
while True:
followLine()
if state == '空':
if isAllBlack():
enter()
goods = detectColor()
if goods == '红' or goods == '蓝':
setClaw(1)
state = '满'
if state == '满':
color = getColor()
if color == goods:
setClaw(0)
state = '空'