This is a micropython script for micro:bit made by Ákos Vecsei
With this script you can use your micro:bit as a Scratch (developed by MIT) controller.
A micro:bit with USB cable.
-
Clone this repo or simple download the scratchbit.py script:
git clone https://github.com/vecsei/Scratchbit.git
So now you have the
scratchbit.py
inside theScratchbit
folder -
Flash it to the micro:bit.
-
Start Scratch
-
Add the built-in
PicoBoard extension
. -
When "C" is displayed on the micro:bit, the connection was established.
-
You can download the
scratchbitdemo.sb2
or use the online version to try it.
-
The
resistance-A
in Scratch represents thepress of the "A" button
on the micro:bit. -
The
resistance-B
in Scratch represents thepress of the "B" button
on the micro:bit. -
The
resistance-C
in Scratch represents theX direction tilt
of the micro:bit. -
The
resistance-D
in Scratch represents theY direction tilt
of the micro:bit. -
The
light
in Scratch represents the value of the micro:bit'sP0 pin
. -
The
sound
in Scratch represents the value of the micro:bit'sP1 pin
. -
The
slider
in Scratch represents the value of the micro:bit'sP2 pin
.
Scratch | micro:bit |
---|---|
resistance-A | press of the "A" button |
resistance-B | press of the "B" button |
resistance-C | X direction tilt |
resistance-D | Y direction tilt |
light | P0 pin |
sound | P1 pin |
slider | P2 pin |