> 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/main-controllers/futureboard/futureboard-kittenblock-programming-tutorial/programming-with-kittenblock-onboard-sensors.md).

# Programming with Kittenblock: Onboard Sensors

here are multiple onboard sensors on Futureboard.

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

### Onboard Sensors Blocks

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

#### Sample Program: Buttons

Pressing the buttons changes the color.

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

#### Sample Program: Temperature and Light sensors

The sensor values are shown on the screen.

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

#### Sample Program: Accelerometer and Gyroscope

Please refer to the following figure for the axis orientation.

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

The acceleration values are shown on the screen.

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

#### Sample Program: Gestures

The Futureboard can detect 8 gestures:

1. ‘shake’
2. ‘freefall’
3. ‘tilt\_up’
4. ‘tilt\_down’
5. ‘tilt\_left’
6. ‘tilt\_right’
7. ‘face\_up’
8. ‘face\_down’

Shake the FutureBoard for a sound.

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

#### Sample Program: Gesture Triggers

Shake the FutureBoard for a sound.

```
Note: Trigger Events only work when the program is uploaded onto the FutureBoard.
```

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

#### Sample Program: Gyroscope

Shows the roll and pitch of the FutureBoard.

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

#### Sample Program: Magnetic Sensor

The magnetic sensor has a range of ±800(μT)。

The magnetic strengths are shown on FutureBoard.

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

```
The magnetic sensor needs to be calibrated before use.
```

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

#### Sample Program: Compass

The compass returns a compass bearing, with 0 indicating North.

The compass bearing is shown.

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


---

# 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-eng.kittenbot.hk/main-controllers/futureboard/futureboard-kittenblock-programming-tutorial/programming-with-kittenblock-onboard-sensors.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.
