Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. from PiBot import PiBot
  2.  
  3. # Create a robot instance
  4. robot = PiBot()
  5.  
  6. # Get distance from object using the front middle IR sensor
  7. robot.sleep(1)
  8. robot.movement = robot.get_left_line_sensors() and robot.get_right_line_sensors() and robot.get_line_sensors()
  9. while robot.movement < 300:
  10. robot.set_wheels_speed(30)
  11. if robot.movement > 300:
  12. robot.get_rotation = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement