Tutorial

MicroPython

micro:bit

Micro:bit Tinker Kit Components

Getting Started

Pre-coding:

  • Get hold of a Micro:bit Tinker Kit

  • Download the Mu editor

  • Before each project, write “from microbit import * ”


LED 

Let the LED be connected to pin0CommandUsagepin0.read_digital()Check if LED is lighted or not
pin0.read_digital() = 0 # means LED is not lighted
pin0.read_digital() = 1 # means LED is lightedpin0.write_digital(value)Turn LED on or off
pin0.write_digital(1) # lights LED
pin0.write_digital(0) # turns LED off

Example: Blink

Pin Layout
LED: Pin0

Join us for the best coding and digital making experiences for students, teachers, and professionals in Singapore and beyond.