Bhavithiran
Published © MIT

Program micro:bit mobile robot with Python | 3 Move Around

A step by step guide to program a micro:bit mobile robot to move around using MicroPython

BeginnerProtip30 minutes686
Program micro:bit mobile robot with Python | 3 Move Around

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

Move Around

Python
This tutorial's full code
from reromicro import *  

rero = reromicro()

while True:
    if button_a.was_pressed():
        rero.Brake()                          # brake
        sleep(2000)                           # delay 2 second
    else :
        if display.read_light_level() > 60:
            rero.RunMotor(-50, 50)            # turn left
            sleep(100)
        else :
            rero.RunMotor(50, 50)             # move forward

Credits

Bhavithiran

Bhavithiran

16 projects • 7 followers

Comments