Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tower():
- #turns about right
- tank_pair.on_for_rotations(15, 0, 1)
- us.mode = 'US-DIST-CM'
- #While it hasn't pressed the top button
- while not ts.value():
- distance = us.value()/10
- #greater than 60cm
- if distance > 60:
- #just slowly move forward
- tank_pair.on_for_rotations(20,20,1)
- else:
- #is than than 60cm
- tank_pair.on_for_rotations(-50,-50,1)
- tank_pair.on_for_rotations(100,100,1)
- break
- #at this stage we should of hit the bottle, now just go forward ?
- while cl.reflected_light_intensity < 30:
- #we should be on the, black finish title, just move forward
- tank_pair.on_for_rotations(50,50,1)
- #Move back to the back title
- tank_pair.on_for_rotations(-10,-10,1)
- #Stop
- tank_pair.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement