---
# System prepended metadata

title: 高二自主 0423
tags: [作業]

---

---
title: 高二自主 0423
tags: 作業
---

> [webduino](https://webduino.io/)

> [學習手冊](https://www.notion.so/smshprogram/Webduino-4751722d0d274b2e965ae2ba341f7cd1)

> [codepen](https://codepen.io/trending)

### 郭尚蓁
#### 超音波
![](https://i.imgur.com/Grxf0aZ.png)


#### 蜂鳴器
![](https://i.imgur.com/7tMVkIW.png)


[進階組挑戰參考資料](https://www.w3school.com.cn/htmldom/prop_style_backgroundcolor.asp)

```javascript=
var ultrasonic;

boardReady({ device: "gQ2dr" }, function (board) {
  board.samplingInterval = 250;
  ultrasonic = getUltrasonic(board, 11, 10);
  ultrasonic.ping(function (cm) {
    document.getElementById("text-show").innerHTML = ultrasonic.distance;
    if (ultrasonic.distance < 20) {
      document.body.style.backgroundColor = "#FF00AA";
    } else {
      document.body.style.backgroundColor = "#668B8B";
    }
  }, 500);
});
```
---

### 洪羽薇

### 楊苡若

### 王政翔

### 陳亭宇

### 余靜玟
