---
# System prepended metadata

title: Untitled

---

LE.# 機器人專題課程

## 01.閃燈 (9/26)
### 程式碼
```javascript=
void setup()
{
    pinMode( D4 , OUTPUT);
}

void loop()
{
    digitalWrite(D4 , HIGH);
    delay( 1000 );
    digitalWrite(D4 , LOW);
    delay( 1000 );

}
```
![](https://i.imgur.com/brxtUk6.png)
### 實作![](https://i.imgur.com/ZE7Y9LE.jpg)
![](https://i.imgur.com/VT9WEBb.jpg)

---


## **02. 蜂鳴器** (10/3)
### 程式碼
```javascript=
void setup()
{
}

void loop()
{
  tone(D8, 440);
  delay( 1000 );
  noTone(D8);
  delay( 1000 );
}
```
[蜂鳴器](https://https://drive.google.com/file/d/19B7-vrmDmciLu2cIotsqAtEdoLjm5tjX/view?usp=sharing)

![](https://i.imgur.com/OiU5iG3.png)
### 實作 ![](https://i.imgur.com/PClBYs0.jpg)

---
## **03. 超音波感測器** (10/24)
### 程式碼
```javascript=
#include <Ultrasonic2.h>

int Range = 0 ;
Ultrasonic2 monUltrasonic_pinD5(D5);

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Range = monUltrasonic_pinD5.mesurer(D5) ;
  Serial.print("message");
  Serial.print(Range);
  Serial.print(" ");
  Serial.println();
  delay( 200 );