Table of Contents

Line Follower Robot – Simplified – Python

Example Description
The example demonstrates how to make a simplified line following a robot with Quarky in the Python Coding Environment.

Code

sprite = Sprite('Tobi')
quarky = Quarky()

quarky.setirthreshold("IRL", 3000)
quarky.setirthreshold("IRR", 3000)
quarky.initializelinefollower(35, 40, 10)

while True:
  if not (quarky.getirstate(35) and quarky.getirstate(34)):
    quarky.dolinefollowing()

  else:
    quarky.stoprobot()

Output