Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BBC Micro:Bit Motor Control x 2 Motors
from microbit import *
m1 = pin13
m2 = pin14
m3 = pin15
m4 = pin16
def right():
m1.write_digital(1)
m2.write_digital(0)
m3.write_digital(0)
m4.write_digital(1)
def left():
m1.write_digital(0)
m2.write_digital(1)
m3.write_digital(1)
m4.write_digital(0)
def forward():
m1.write_digital(0)
m2.write_digital(0)
m3.write_digital(1)
m4.write_digital(1)
def reverse():
m1.write_digital(1)
m2.write_digital(1)
m3.write_digital(0)
m4.write_digital(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.