8000 GitHub - kazuzak/mbit-more-v2: Full-functional extension of micro:bit for Scratch3
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kazuzak/mbit-more-v2

 
 

Repository files navigation

Microbit More v2

Version Documentation Maintenance License: MIT

work with micro:bit v1 and v2

Full-functional extension of micro:bit for Scratch3

🏠 Homepage (in Japanese)

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).

How to Use

Get a micro:bit (either v1 or v2) and a PC then follow the steps below.

  1. download extension program microbit-mbit-more-v2-0_2_0.hex on your micro:bit
  2. calibrate compass by playing 'TILT TO FILL SCREEN' (How to calibrate the micro:bit compass : Help & Support)
  3. open Microbit More Web-App
  4. click (!) button in the "Microbit More" category to scan micro:bit (run Scratch Link if you claimed it)
  5. select your micro:bit on the device list then click pair
  6. return to the editor and click [display pattern [:heart:]] to check the connection with your micro:bit

Restrictions

  • 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.

Setup Development Environment

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

Register in self-build Scratch3

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.

Xcratch Module Building

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")

Author

👤 Koji Yokokawa

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020-2021 Koji Yokokawa.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

Full-functional extension of micro:bit for Scratch3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.7%
  • Shell 2.0%
  • HTML 0.3%
0