Microsoft MakeCode

Extensions in custom Editor

I am trying to figure out if I can use existing extenstions in a custom makecode tutorial. Specifically the Neopixel extension with Microbit.

Is there a way to use extensions in the tutorials space

I have built my custom tutorial with
https://makecode.com/writing-docs/tutorials

The below does not work as the neopixel extension is not enabled in the tutorial.
let strip2 = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB)

1 Like

For builtin extensions: at the bottom of this file, you can see the packages snippet that indicates the extension the tutorial needs to load. I would expect you just need neopixel there instead of corgio, but I’d have to check. (If you need multiple extensions, just add another line)

For extensions on github: This tutorial I wrote uses an extension that handles almost all of the game logic, so there are just a few blocks the play can customize it with. To get an extension in your project, you’ll want to add a snippet with syntax like the bottom here.

Ill see about updating the docs later to be clear on gow to do this~

1 Like

Cheers @jwunderl,

I tried the following and unfortunately came up with no extension being loaded.
package pxt-neopixel
And
package neopixel
And
package pxt-neopixel=github:microsoft/pxt-neopixel#v0.6.12

Ahh, forgot that neopixel is in a separate repo; the last one should be working I believe? E.g. example below shows up as https://makecode.microbit.org/beta#tutorial:22058-41215-69115-76860

# Test

## Step 1

Instructions for step 1 of activity 1 here...

```blocks
let strip2 = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB)
```

## Step 2

Instructions for step 2 of activity 1 here...


```package
neopixel=github:microsoft/pxt-neopixel#v0.6.12
```
1 Like

Cheers for that, I must have had a typo in my test.
That solved the issue I was having :slight_smile: