BrainPad Adding Extensions?

Hello Brain Padders ! How do I add a “light” extension for the BrainPad? I was working with the MS MakeCode guys and they added this extension to MakerMakeCode so I can make an LED light ring play a light show: RGB LED WS2812-B with 8 neopixels. I would like to do that same thing as a block coding choice under Advanced: Extensions for the BrainPad so I can add an LED ring, square or strip. I tried the GitHub route but couldn’t figure out how to install the “light” extension. Here is the link to the MakerMakeCode site for block programming the Adafruit Trinket M0 board to drive the light show: if you click on Trinket M0 and “Advanced” and then “Extensions” and then the “light” catagory; MakeCode Maker - Blocks / Javascript editor

here’s my video showing the light ring after block coding the Trinket: MakeCode Drives 8 NeoPixel Ring Block Coding - YouTube

1 Like

I believe these are native code extensions that get linked in the system. They are very powerful but they are board specific. I do not think you can an extension made for a board into another board.

I do not recall seeing documentation on how to make new extensions. Have you seen any?

Checking into making extensions for MakeCode, will report back.

This guy seems to know something about altering MakeCode, I’ll contact him on Discord. Hope this link works for you, Gus:

1 Like

Possibly getting answers for “extensions”. The reason this is important is because , in my opinion, there is a huge volume of ‘libraries’ written for Arduino for interaction between hardware electronics components and and CPUs and the computer machine of choice. On that basis, while the language and dev. environments are different between MakeCode system and Arduino, in some cases, the people writing code for the outputs like the RBG LEDs (which are highly engaging for kids) these programmers know how the systems work and look like they can draw on libraries to make Cortex M(x) boards perform as we’d like them to. Here’s a prelim. answer:
pelikhan is admin. for MakeCode on Discord/Adafruit

pelikhanToday at 11:33 AM

> How do we make extensions for other Cortex M based boards? Your extension will apply to any board as long as the feature you need support it. Eg, if you need serial comm, not all of our boards have it implemented.

> Is the ‘light’ extension only good on the Trinket M0? The “light” package relies on Digital IO so it works for any board that has digital pins.

FrankSchmidtToday at 1:47 PM

Thanks for that, @pelikhan. I will pursue this further.

I will need someone to work with at GHI on this extension issue, Gus. I don’t want to take up any more of your time on this. I have been to BrainPad “Advanced” and “Extensions” and found “add Extension” at the bottom of the page. I went to GitHub, logged in and created a personal token. I would like to learn how to move forward from here to add extensions to (at least for my use) add extensions found on other board types (Trinket M0, and others) to the BrainPad library of functions , I see a good number of them that are not yet available for the BrainPad as yet because they have not been added. Here’s what I found on the procedure: If you’re ok with my working on this then please forward this note to whoever would be best to work with, thanks, Frank

"You’ll need to paste in a token again for each editor you use (micro:bit, Circuit Playground, etc.), though you can use the same token for all of them.

Once you’ve logged in, go back to the home screen. Now, the dialog that comes up after you press the Import button will have an additional option to list your GitHub repositories or create a new one. Additionally, the Import URL option will now support URLs, which is useful if you can’t find your repository in the list (especially organizational repos), or as way to search the list faster using a copy/paste of the URL."

First let me say that I have not try this myself but I knew about it. Here is a hidden secret, under extension you will see “game”. It is very cool way for adding games on your BrainPad.

As for extensions, this is an evolving feature so expect gotchas, but you like challenges, right? :slight_smile: It might even be completely broken while Microsoft finish whatever they are working on but we won’t know till we try.

Looks like the latest page is here GitHub extension authoring

I would start by making a very basic extension. Do not worry about sensors/devices for now. Once you get it going together then you can start adding actual fancy code. Maybe you can blog about our experience as I am sure others would like to understand what you are doing.

Yes, and I am up for it. Your suggestion of simple first is well taken . Yes, your BrainPad game is very important addition to the system. I have found that younger teachers are attracted to working with students in games more so than working with electronics (which is my passion). Anything we can do: games included, to interest kids and adults in coding and electronics is good.

Now, to add to the mystery, here is an expert commenting about “weird” stuff with MakeCode, if she is puzzled, I don’t feel so bad ! ! ! Yes, Lady Ada, herself.

ladyadaToday at 3:17 PM

@pelikhan something defintely weird with i2c recently

i opened an issue, but getting an ‘error code’ on the neopixels, never seen it before!

Make code is amazing but a lot of changes are happening, which is but a bad thing in the long run.