> 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/extension-boards/robotbit-edu/robotbitkb.md).

# Robotbit Edu Coding with KittenBlock

Robotbit Edu can be programmed with KittenBlock.

Refer to this page for introduction with Kittenblock: [Kittenblock Introduction](https://kittenbothk-eng.readthedocs.io/en/latest/Microbit_eboard/KittenBlock/index)

### Kittenblock Coding

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

Connect the Micro:bit to your computer with a USB cable.

Click select hardware and choose MicroBit Python from the menu.

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

Press this exclamation mark(!).

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

Click this button to connect the Micro:bit.

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

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

Micro:bit will display a heart icon after connecting to Kittenblock.

If the Micro:bit does not show a heart icon,

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

#### The blocks for Robotbit will be added[](https://kittenbothk-eng.readthedocs.io/en/latest/Microbit_eboard/Robotbit_edu/robotbitKB.html#the-blocks-for-robotbit-will-be-added)

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

#### 1. Programming Motors

For information about DC motors by Kittenbot, please visit: [Kittenbot Actuators](https://kittenbothk-eng.readthedocs.io/en/latest/motors/index.html)

**Sample Program:**

Connect 2 DC motors to the M1A and M1B port of the Robotbit.

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

```
The speed of motor ranges from -255 to 255.
```

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

#### 2. Programming Servos

For information about servos by Kittenbot, please visit: [Kittenbot Actuators](https://kittenbothk-eng.readthedocs.io/en/latest/motors/index.html)

**Sample Program:**

Connect a servo to the S1 port of Robotbit.

```
Connect the orange wire from the servo to the yellow wire of the Robotbit.
```

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

```
Typical servos have a rotation range of 0-180.
```

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

#### 3. Programming Stepper Motors

For information about DC motors by Kittenbot, please visit: [Kittenbot Actuators](https://kittenbothk-eng.readthedocs.io/en/latest/motors/index.html)

**Sample Program:**

Connect Stepper Motors to the M1 and M2 port of the Robotbit, with the red wire connecting to the VM port.

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

```
Stepper Motors have a rotation range of -360 to 360.
```

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

#### 4. Programming the built-in LED strip

```
Remember to add a "Show" block to display the effect.
```

**4.1 Lighting up all lights**

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

**4.2 Customizing color with RGB**

```
RGB value has a range of 0-255.
```

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

**4.3 Lighting up individual lights**

```
The lights are labelled 0-3. (As labelled on the Robotbit)
```

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

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

#### 5. Programming the IO Pins

The blocks for the IO pins are found in the menu for Micro:bit.

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

```
Pin 0-2 can be used as analog pins while P8, P12~P15 can only be used as digital pins.
Analog values have a range of 0 to 1023, digital values have a range of 0 to 1.
```

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

**5.1 Reading values from pins**

```
Pin 0 is occupied by the buzzer by default, the jumper should be removed when using this pin.
```

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

**5.2 Writing values to pins**

```
Pin 0 is occupied by the buzzer by default, the jumper should be removed when using this pin.
```

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

a


---

# 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/extension-boards/robotbit-edu/robotbitkb.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.
