# Programming with MicroPython: Robotbit

### Import FutureBoard Library

Import the Library to make use of its functions.

```
from future import *
```

### 11: RobotBit

### Import Robotbit Library

```
import robotbit
```

#### 1. Initiate a Robotbit Object

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

#### 2. Motor Speed

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

Parameter index indicates the port of motor, value range is 1\~4. Parameter speed controls the speed, value range is -255\~255.

#### 3. Stop All Motors

```
rb.motorStopAll()
```

#### 4. Control Servos

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

Parameter index indicates the servo port, value range is S1\~S8. Parameter angle controls the angle, value range is 0\~180.

#### 5. Control GeekServo 9G Servos

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

Parameter index indicates the servo port, value range is S1\~S8. Parameter angle controls the angle, value range is -45\~225.

#### 6. Control GeekServo 2K Servos

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

Parameter index indicates the servo port, value range is S1\~S8. Parameter angle controls the angle, value range is 0\~360.

#### 7. Twin Stepper Motors

```
rb.stepperDual(degree1,degree2)

Parameters degree1 and degree2 control M1 and M2 respectively.
```

#### 8. Single Stepper Motor

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

Use index to select the motor port, value range is 1\~2. Parameter degree controls the angle.


---

# Agent Instructions: 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/main-controllers/futureboard/futureboard-micropython-programming-tutorial/programming-with-micropython-robotbit.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.
