Bhavithiran
Published © MIT

Program micro:bit mobile robot with Python | 5 Line Follow

A step by step guide to program a micro:bit mobile robot to line follow using MicroPython

BeginnerProtip30 minutes931
Program micro:bit mobile robot with Python | 5 Line Follow

Things used in this project

Hardware components

Cytron Technologies rero:micro
×1

Software apps and online services

Mu
Python Editor for micro:bit

Story

Read more

Code

Line Follow

Python
This tutorial's full code
from reromicro import *  

rero = reromicro()
while True:
    rero.ReadLineSensors()
    
    if rero.LineSensorDetectsLine(rero.centerSensor):
      rero.RunMotor(50, 50)

    elif rero.LineSensorDetectsLine(rero.rightSensor):
       rero.RunMotor(40, -40)

     elif rero.LineSensorDetectsLine(rero.leftSensor):
       rero.RunMotor(-40, 40)

Credits

Bhavithiran

Bhavithiran

16 projects • 7 followers

Comments