Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. def tower():
  2. #turns about right
  3. tank_pair.on_for_rotations(15, 0, 1)
  4.  
  5. us.mode = 'US-DIST-CM'
  6. #While it hasn't pressed the top button
  7. while not ts.value():
  8. distance = us.value()/10
  9. #greater than 60cm
  10. if distance > 60:
  11. #just slowly move forward
  12. tank_pair.on_for_rotations(20,20,1)
  13. else:
  14. #is than than 60cm
  15. tank_pair.on_for_rotations(-50,-50,1)
  16. tank_pair.on_for_rotations(100,100,1)
  17. break
  18.  
  19. #at this stage we should of hit the bottle, now just go forward ?
  20. while cl.reflected_light_intensity < 30:
  21. #we should be on the, black finish title, just move forward
  22. tank_pair.on_for_rotations(50,50,1)
  23. #Move back to the back title
  24. tank_pair.on_for_rotations(-10,-10,1)
  25. #Stop
  26. tank_pair.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement