Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. from PiBot import PiBot
  2.  
  3. # Create a robot instance
  4. robot = PiBot()
  5.  
  6. #
  7. listmove = robot.get_line_sensors
  8. listmove[0] = robot.get_leftmost_line_sensor()
  9. listmove[1] = robot.get_second_line_sensor_from_left()
  10. listmove[2] = robot.get_third_line_sensor_from_left()
  11. listmove[3] = robot.get_rightmost_line_sensor()
  12. listmove[4] = robot.get_second_line_sensor_from_right()
  13. listmove[5] = robot.get_third_line_sensor_from_right()
  14. while True:
  15. if listmove[0] < 300 or listmove[1] > 300 or listmove[2] > 300 or listmove[3] > 300 or listmove[4] > 300 or listmove[5] > 300:
  16. robot.set_wheels_speed(30)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement