Full-functional extension of micro:bit for Scratch3
🏠 Homepage (in Japanese)
✨ Open Microbit More Web-App
This is a mod application from Scratch3 by MIT. You can code using 'Microbit More' and all blocks in nomal Scratch3 on this app.
You don't need to run Scratch Link when your browser is Chrome, Edge or 'Web Bluetooth API' supporting one (the browser in Chromebook, Bluefy in iPadOS, like that).
Get a micro:bit (either v1 or v2) and a PC then follow the steps below.
- download extension program microbit-mbit-more-v2-0_2_0.hex on your micro:bit
- calibrate compass by playing 'TILT TO FILL SCREEN' (How to calibrate the micro:bit compass : Help & Support)
- open Microbit More Web-App
- click (!) button in the "Microbit More" category to scan micro:bit (run Scratch Link if you claimed it)
- select your micro:bit on the device list then click pair
- return to the editor and click [display pattern [:heart:]] to check the connection with your micro:bit
- Do not share on the official Scratch website. (You can save project on your PC and share the file)
- Messaging blocks are not available for micro:bit v1.
Use yokobond/scratch-gui at xcratch as a base scratch-gui if you use Web Bluetooth feature.
(This extension works well on "LLK/scratch-gui". But the normal Scratch does not have Web Bluetooth feature. So you have to launch "Scratch Link" with normal Scratch.)
git clone -b xcratch https://github.com/yokobond/scratch-gui.git
cd ./scratch-gui
npm install
Download the Scratch3 repositories according to the supporsed directory configuration.
.
|-- mbit-more-v2
|-- scratch-gui
Install node modules and setup to use local repo for development.
cd ./mbit-more-v2
npm install
npm run setup:local
npm run register:local
To register this extention in your self-build Scratch3 based on Xcratch, execute scripts/register.js
with options as follows.
node ./scripts/register.js --id=microbitMore --gui="../scratch-gui"
When you use the normal "LLK/scratch-gui", register with --base=LLK
.
CAUTION: The normal "LLK/scratch-gui" doesn't have Web Bluetooth featur.
node ./scripts/register.js --id=microbitMore --gui="../scratch-gui" --base=LLK
register.js accepts these commandline arguments.
- --base : base code to register in (optional, availables: "LLK")
- --link : use symbolic link instead of copy sources
- --id : extensionID of this extension
- --block : location of block files from current dir (optional, default: "./src/block")
- --entry : location of entry files from current dir (optional, default: "./src/ently")
- --dir : directory name of the extension will be copied (optional, default: extensionID)
- --gui : location of scratch-gui from current dir (optional, default: "../scratch-gui")
- --vm : location of scratch-vm form current dir (optional, default: "gui/node_modules/scratch-vm")
- --url : URL to get this module as a lodable extension for Xcratch (optional)
- -C : make the extension as a member of core-extensions
CAUTION: register-script will change 'extension default
' in scratch-gui/src/lib/libraries/extensions/index.jsx
as follows.
change from the original code
export default [...];
to
const extensions = [...];
export default extensions;
It may break registration mechanism of the other extensions.
Build module as loadable extension for Xcratch.
node ./scripts/build.js --name=microbitMore --block="./src/block" --entry="./src/entry" --gui="../scratch-gui" --output="./dist"
build.js accepts these commandline arguments.
- --name: name of the module file (without '.mjs')
- --block : location of block files from current dir
- --entry : location of entry files from current dir
- --gui : location of scratch-gui from current dir (optional, default: "../scratch-gui")
- --vm : location of scratch-vm form current dir (optional, default: "gui/node_modules/scratch-vm")
- --url : URL to get its module as a lodable extension for Xcratch (optional)
- --output : location to save module form current dir (optional, default: "./build")
👤 Koji Yokokawa
- Website: http://www.yengawa.com/
- Github: @yokobond
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2020-2021 Koji Yokokawa.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator