# 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: 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.kittenbot.hk/mcu/meowbit/coding/meowbit_light.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.
