Skip to content

jp-rad/pxt-ubit-extension

Repository files navigation

Open this page at GitHub Pages: https://jp-rad.github.io/pxt-ubit-extension/

Creating Extensions

Extensions are PXT’s dynamic/static library mechanism for extending a target, such as the pxt-micro:bit:

Use this template

Use as Extension

This repository can be added as an extension in MakeCode.

Edit this project Build status badge

To edit this repository in MakeCode.

Blocks preview

A rendered view of the blocks

Blocks embed

https://makecode.microbit.org/blocks-embed

Copy the following text at the bottom of your README.md file.


<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/jp-rad/pxt-ubit-extension/.github/statics/gh-pages-img.css">
<script src="https://cdn.jsdelivr.net/gh/jp-rad/pxt-ubit-extension/.github/statics/gh-pages-embed.js"></script>
<script>makeCodeRender("{{ site.makecode.home_url }}", [ "custom=github:jp-rad/pxt-ubit-extension", ]);</script>

blocks

Example1

custom.foo(4, "Hello", MyEnum.One)

Example2

input.onButtonPressed(Button.A, function () {
    basic.showNumber(custom.baz())
})
input.onButtonPressed(Button.B, function () {
    basic.showNumber(custom.bar())
})

Downloaded HEX file to Use as Extension

Released HEX file can be imported as an extension in MakeCode.

Metadata (used for search, rendering)

  • for PXT/microbit
<script src="https://cdn.jsdelivr.net/gh/jp-rad/pxt-ubit-extension/.github/statics/gh-pages-embed.js"></script> <script>makeCodeRender("{{ site.makecode.home_url }}", [ "custom=github:jp-rad/pxt-ubit-extension", ]);</script>