# JoyFrog micro:bit遙控在MakeCode編程教學

### MakeCode編程教學

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

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

#### 加載JoyFrog插件：

#### 在擴展頁直接搜尋JoyFrog (joyfrog已經過微軟認證，可以直接搜尋)

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

**JoyFrog積木塊：**

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

**搖桿編程：**

推動搖桿，Microbit就會顯示搖桿值。

{% embed url="<https://makecode.microbit.org/_Ty95YCWwUC3s>" %}

[參考程式網址](https://makecode.microbit.org/_Ty95YCWwUC3s)

**按鈕編程：**

按下按鈕，Microbit會顯示您按下的按鈕。

{% embed url="<https://makecode.microbit.org/_THaPh5RTVRRt>" %}

[參考程式網址](https://makecode.microbit.org/_THaPh5RTVRRt)

**鋼琴編程：**

利用JoyFrog底部的金手指，我們可以當作鋼琴使用。

嘗試連接不同的導電物件，例如水果，餐具等，創作你獨一無二的鋼琴吧。

{% embed url="<https://makecode.microbit.org/_79zhcpKDT9o0>" %}

[參考程式網址](https://makecode.microbit.org/_79zhcpKDT9o0)

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

這裡使用了JoyFrog的蜂鳴器發聲，大家還可以加插喇叭發聲。

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

**紅外線發訊號編程：**

按下按鍵，發射紅外線訊號。

```
紅外線訊號只支援16進位數值(hexadecimal)。
```

{% embed url="<https://makecode.microbit.org/_Wvp6vxiPMLWr>" %}

[參考程式網址](https://makecode.microbit.org/_Wvp6vxiPMLWr)

**紅外線收訊號編程：**

顯示紅外線收到的訊號。

```
紅外線訊號只支援16進位數值(hexadecimal)。
```

{% embed url="<https://makecode.microbit.org/_DoM9fj6Cj97U>" %}

[參考程式網址](https://makecode.microbit.org/_DoM9fj6Cj97U)

**類比讀取編程：**

按下按鍵，讀取類比模組(例如電位器)的數字。

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

{% embed url="<https://makecode.microbit.org/_HLtdh2Ha6KMp>" %}

[參考程式網址](https://makecode.microbit.org/_HLtdh2Ha6KMp)

**類比寫入(PWM)編程：**

按下按鍵，以PWM寫入類比數值(例如LED燈或者舵機)。

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

{% embed url="<https://makecode.microbit.org/_1y8ET7e7A8TF>" %}

[參考程式網址](https://makecode.microbit.org/_1y8ET7e7A8TF)

**數位數字讀取：**

按下按鍵，讀取數位模組(例如按鍵)的數字。

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

{% embed url="<https://makecode.microbit.org/_Dd71FegibTs3>" %}

[參考程式網址](https://makecode.microbit.org/_Dd71FegibTs3)

**數位數字寫入：**

按下按鍵，寫入數位數字。

{% embed url="<https://makecode.microbit.org/_UKU0K75uYcyL>" %}

[參考程式網址](https://makecode.microbit.org/_UKU0K75uYcyL)


---

# 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/expansion_board/joyfrog/joyfrogmc.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.
