> 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/meowbit/coding/meowbit_light.md).

# MeowBit的光度感應器

Meowbit上搭載了光度感應器，可以探測光度數值和判斷環境為黑暗或明亮。

### MakeCode Arcade編程教學

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

#### 載入控制器插件

#### [詳細方法](/programmingplatforms/makecode/kittenbotandmakecode.md)

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

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

#### 控制器積木塊

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

#### 光度感應編程

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

當我們遮擋著Meowbit的光度感應器的時候，小鴨會說出”很暗”，用電筒照射它時說出”很光”。

[參考程式](https://makecode.com/_EUyfs590PdhJ)

#### 探測光度數值編程

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

```
光度數值範圍由0-255
```

小鴨會一直說出現時的光度數值。

[參考程式](https://makecode.com/_VbYeA6apKPd0)

### Kittenblock編程教學

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

#### 探測光度數值編程

![](https://kittenbothk.readthedocs.io/en/latest/_images/light5.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.kittenbot.hk/mcu/meowbit/coding/meowbit_light.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.
