> For the complete documentation index, see [llms.txt](https://sharinghub.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.kittenbot.hk/mcu/futureboard/micropython/api11.md).

# 未來板MicroPython編程11：RobotBit

### 導入未來板庫

需要先導入未來板的庫才可以使用未來板的硬件。

```
from future import *
```

### 11: RobotBit

### 導入RobotBit庫

```
import robotbit
```

#### 1. 初始化Robotbit擴展板

```
rb=robotbit.RobotBit()
```

#### 2. 控制電機

```
rb.motor(index,speed)
```

* index為電機序號，1\~4。
* speed代表速度，-255\~255。

#### 3. 停止所有電機

```
rb.motorStopAll()
```

#### 4. 控制180度舵機

```
rb.servo(index,degree)
```

* index可以填1\~8代表接口S1\~S8。 degree為角度，0\~180度。

#### 5. 控制GeekServo 9G舵機

```
rb.geekServo9g(index,degree)
```

* index可以填1\~8代表接口S1\~S8。
* degree為角度，-45\~225度。

#### 6. 控制GeekServo 2K舵機

```
rb.geekServo2kg(index,degree)
```

* index可以填1\~8代表接口S1\~S8。
* degree為角度，0\~360度。

#### 7. 轉動雙步進電機

```
rb.stepperDual(degree1,degree2)

degree1和degree2分別代表M1和M2。
```

#### 8. 轉動步進電機

```
rb.stepperDegree(index,degree)
```

* index為電機序號，1\~2。
* degree為角度。


---

# 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, and the optional `goal` query parameter:

```
GET https://sharinghub.kittenbot.hk/mcu/futureboard/micropython/api11.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
