├── Gemfile
├── test.ts
├── Makefile
├── .gitignore
├── _config.yml
├── tsconfig.json
├── main.ts
├── pxt.json
├── .github
└── workflows
│ └── makecode.yml
├── .vscode
├── settings.json
└── tasks.json
├── README.md
└── main.blocks
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | gem 'github-pages', group: :jekyll_plugins
--------------------------------------------------------------------------------
/test.ts:
--------------------------------------------------------------------------------
1 | // tests go here; this will not be compiled when this package is used as an extension.
2 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | all: deploy
2 |
3 | build:
4 | pxt build
5 |
6 | deploy:
7 | pxt deploy
8 |
9 | test:
10 | pxt test
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # MakeCode
2 | built
3 | node_modules
4 | yotta_modules
5 | yotta_targets
6 | pxt_modules
7 | _site
8 | *.db
9 | *.tgz
10 | .header.json
11 | .simstate.json
12 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | makecode:
2 | target: microbit
3 | platform: microbit
4 | home_url: https://makecode.microbit.org/
5 | theme: jekyll-theme-slate
6 | include:
7 | - assets
8 | - README.md
9 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "noImplicitAny": true,
5 | "outDir": "built",
6 | "rootDir": "."
7 | },
8 | "exclude": ["pxt_modules/**/*test.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/main.ts:
--------------------------------------------------------------------------------
1 | let strip = neopixel.create(DigitalPin.P0, 60, NeoPixelMode.RGB)
2 | basic.forever(function () {
3 | strip.showColor(neopixel.colors(NeoPixelColors.Red))
4 | strip.show()
5 | basic.pause(100)
6 | strip.showColor(neopixel.colors(NeoPixelColors.Green))
7 | strip.show()
8 | basic.pause(100)
9 | strip.showColor(neopixel.colors(NeoPixelColors.Blue))
10 | strip.show()
11 | basic.pause(100)
12 | })
13 |
--------------------------------------------------------------------------------
/pxt.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "NeoPixels",
3 | "description": "",
4 | "dependencies": {
5 | "core": "*",
6 | "radio": "*",
7 | "neopixel": "github:microsoft/pxt-neopixel#v0.7.3"
8 | },
9 | "files": [
10 | "main.blocks",
11 | "main.ts",
12 | "README.md"
13 | ],
14 | "testFiles": [
15 | "test.ts"
16 | ],
17 | "supportedTargets": [
18 | "microbit"
19 | ],
20 | "preferredEditor": "blocksprj"
21 | }
22 |
--------------------------------------------------------------------------------
/.github/workflows/makecode.yml:
--------------------------------------------------------------------------------
1 | name: MakeCode
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 |
8 | runs-on: ubuntu-latest
9 |
10 | strategy:
11 | matrix:
12 | node-version: [8.x]
13 |
14 | steps:
15 | - uses: actions/checkout@v1
16 | - name: Use Node.js ${{ matrix.node-version }}
17 | uses: actions/setup-node@v1
18 | with:
19 | node-version: ${{ matrix.node-version }}
20 | - name: npm install
21 | run: |
22 | npm install -g pxt
23 | pxt target microbit
24 | - name: build
25 | run: |
26 | pxt install
27 | pxt build --cloud
28 | env:
29 | CI: true
30 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.formatOnType": true,
3 | "files.autoSave": "afterDelay",
4 | "files.watcherExclude": {
5 | "**/.git/objects/**": true,
6 | "**/built/**": true,
7 | "**/node_modules/**": true,
8 | "**/yotta_modules/**": true,
9 | "**/yotta_targets": true,
10 | "**/pxt_modules/**": true
11 | },
12 | "files.associations": {
13 | "*.blocks": "html",
14 | "*.jres": "json"
15 | },
16 | "search.exclude": {
17 | "**/built": true,
18 | "**/node_modules": true,
19 | "**/yotta_modules": true,
20 | "**/yotta_targets": true,
21 | "**/pxt_modules": true
22 | }
23 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 |
2 | // A task runner that calls the MakeCode (PXT) compiler
3 | {
4 | "version": "2.0.0",
5 | "tasks": [{
6 | "label": "pxt deploy",
7 | "type": "shell",
8 | "command": "pxt deploy --local",
9 | "group": "build",
10 | "problemMatcher": [ "$tsc" ]
11 | }, {
12 | "label": "pxt build",
13 | "type": "shell",
14 | "command": "pxt build --local",
15 | "group": "build",
16 | "problemMatcher": [ "$tsc" ]
17 | }, {
18 | "label": "pxt install",
19 | "type": "shell",
20 | "command": "pxt install",
21 | "group": "build",
22 | "problemMatcher": [ "$tsc" ]
23 | }, {
24 | "label": "pxt clean",
25 | "type": "shell",
26 | "command": "pxt clean",
27 | "group": "test",
28 | "problemMatcher": [ "$tsc" ]
29 | }]
30 | }
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | > Open this page at [https://raster.github.io/microbit-stuff/](https://raster.github.io/microbit-stuff/)
3 |
4 | ## Use as Extension
5 |
6 | This repository can be added as an **extension** in MakeCode.
7 |
8 | * open [https://makecode.microbit.org/](https://makecode.microbit.org/)
9 | * click on **New Project**
10 | * click on **Extensions** under the gearwheel menu
11 | * search for **https://github.com/raster/microbit-stuff** and import
12 |
13 | ## Edit this project 
14 |
15 | To edit this repository in MakeCode.
16 |
17 | * open [https://makecode.microbit.org/](https://makecode.microbit.org/)
18 | * click on **Import** then click on **Import URL**
19 | * paste **https://github.com/raster/microbit-stuff** and click import
20 |
21 | ## Blocks preview
22 |
23 | This image shows the blocks code from the last commit in master.
24 | This image may take a few minutes to refresh.
25 |
26 | 
27 |
28 | #### Metadata (used for search, rendering)
29 |
30 | * for PXT/microbit
31 |
32 |
--------------------------------------------------------------------------------
/main.blocks:
--------------------------------------------------------------------------------
1 | stripstrip2strip0DigitalPin.P0NeoPixelMode.RGB60stripNeoPixelColors.Redstrip100stripNeoPixelColors.Greenstrip100stripNeoPixelColors.Bluestrip100
--------------------------------------------------------------------------------