# B05. Grove LED 燈條

### 專案說明 <a href="#b05.groveled-deng-tiao-zhuan-an-shui-ming" id="b05.groveled-deng-tiao-zhuan-an-shui-ming"></a>

使用 **Grove擴充板** 連接 **LED 燈條** ([Grove -](http://wiki.seeed.cc/Grove-Relay/)[ LED Bar](http://wiki.seeed.cc/Grove-LED_Bar/))，控制燈條的亮度刻度從最低到最高，每秒進一格。&#x20;

{% hint style="info" %}
此**燈條**包含於 [**Grove Starter Kit for LinkIt 7697**](https://www.seeedstudio.com/Grove-Starter-Kit-for-LinkIt-7697-p-2834.html) 內。 使用此範例前請先閱讀 [**Grove 相關基礎知識**](https://docs.labs.mediatek.com/linkit-7697-blocklyduino/b00-grove-12880112.html)， 並依照其內的說明步驟[**安裝 Grove 相關驅動程式**](https://docs.labs.mediatek.com/linkit-7697-blocklyduino/b00-grove-12880112.html#B00.Grove%E7%9B%B8%E9%97%9C%E5%9F%BA%E7%A4%8E%E7%9F%A5%E8%AD%98-grove_driver)
{% endhint %}

![](/files/KVF8V4AoSX5F1PQdQdMn)

### 電路圖  <a href="#b05.groveled-deng-tiao-dian-lu-tu" id="b05.groveled-deng-tiao-dian-lu-tu"></a>

* [LinkIt 7697](https://robotkingdom.com.tw/product/linkit-7697/)
* [Grove breakout for LinkIt 7697](https://robotkingdom.com.tw/product/linkit-7697-2/)
* [Grove - ](https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html)[LED Bar v2.0](https://www.seeedstudio.com/Grove-LED-Bar-v2.0-p-2474.html)

{% hint style="info" %}
**LED 燈條**是**數位訊號輸出**， 可以接 **D2/D3/D4/D10/D12** 的 Grove 連接埠。 本範例連接到 **D2**
{% endhint %}

![](/files/I98WJqdXVPrGQwc3dLZ2)

### 積木畫布 <a href="#b05.groveled-deng-tiao-ji-mu-hua-bu" id="b05.groveled-deng-tiao-ji-mu-hua-bu"></a>

![](/files/Q8Ff9Au5wXA3PdEfyx8C)

產生出的 Arduino 程式如下

```
#include <Grove_LED_Bar.h>

int i;

Grove_LED_Bar __bar2(3, 2, 0);

void setup()
{
  __bar2.begin();
}

void loop()
{
  for (i = 0; i <= 10; i++) {
    __bar2.setLevel(i);
    delay(1000);
  }

  delay(1000);
}
```


---

# 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://cavedu.gitbook.io/linkit-7697/linkit-7697-blocklyduino-shi-yong-zhi-nan/shi-zuo-fan-li-jiao-xue/b05.-grove-led-deng-tiao.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.
