Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def detectyellow():
- stop()
- picture = takePicture()
- show(picture)
- for pixel in getPixels(picture):
- r, g, b = getRGB(pixel)
- if (r >= 150 and g >= 150 and b <=110):
- try:
- while(getObstacle('center') < 6400):
- forward(1,0.2)
- wait(1)
- celebrate()
- return 2
- except:
- print("The obstacle sensor likely overloaded")
- else:
- return 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement