onlinecodesimulator/readme.md

12 lines
274 B
Markdown
Raw Normal View History

import robot
2025-03-27 03:00:57 +00:00
import time
robot.move(0.00006)
2025-03-27 03:00:57 +00:00
while True:
if robot.get_sensors()[0]["hitpoint"]["x"] is not None:
robot.turn(0.001)
elif robot.get_sensors()[1]["hitpoint"]["x"] is not None:
robot.turn(-0.001)
else:
robot.turn(0)
time.sleep(0.1)