> For the complete documentation index, see [llms.txt](https://sharinghub-eng.kittenbot.hk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharinghub-eng.kittenbot.hk/wifibrick_iot/makecode/objectblocks.md).

# Makecode Coding and ObjectBlocks

### Foreword

The following tutorial is for WifiBrick and Robotbit, for KOI users, some programs may need adjustments to work on KOI.

### 1: Setting Up ObjectBlocks

Create an account on ObjectBlocks.

[ObjectBlocks](https://www.objectblocks.cc/)

Log in and create a new project.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object1.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object2.png)

Select Channels from the menu.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object3.png)

Add a new channel.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object4.png)

Specify the type to be either text or numeric.

Remember to choose YES for the webhook option.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object5.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object6.png)

The webhook option contains credentials for accessing your channel, please keep confidential.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object7.png)

Publishing and subscribing to the channels requires credentials.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object8.png)

In order to visualize the data on ObjectBlocks, we need to create a dashboard. Add a new dashboard via the menu.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object9.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object10.png)

Add a tool.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object11.png)

Many kinds of representations are available, for this tutorial, text will be used.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object12.png)

Select the channel we’ve just created.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object13.png)

### 2. MakeCode Coding

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/mcbanner.png)

#### Import WifiBrick Extension

Search for Kittenbot and import KittenWifi.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object14.png)

```
For KOI user, import KOI.
```

#### 1: Connecting to ObjectBlocks platform.

Fill in the authentication credentials for ObjectBlocks.

MQTT Host: hub2.objectblocks.cc Node: Does not matter Username: Your username(Host) Password: Your password(Pass)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object15.png)

#### 2: Publishing to ObjectBlocks

Copy and paste your ObjectBlocks topic into the publishing block.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object16.png)

#### 3: Subscribing to ObjectBlocks

Copy and paste your ObjectBlocks topic into the subscribing block.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object19.png)

#### 4. Final Program

Press A to publish a random number to ObjectBlocks, the number is shown on the Dashboard as well as the Micro:bit.

![.](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object21.png)

#### Sample Program

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/object20.png)

[Sample Program](https://makecode.microbit.org/_3Picjj2KRChw)

### Extension Version and Updates

There may be updates to extensions periodically, please refer to the following link to update/downgrade your extension.

[Makecode Extension Update](https://kittenbothk-eng.readthedocs.io/en/latest/Makecode/makecode_extensionUpdate.html)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharinghub-eng.kittenbot.hk/wifibrick_iot/makecode/objectblocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
