---
# System prepended metadata

title: 高一十班 0603
tags: [作業]

---

---
title: 高一十班 0603
tags: 作業
---

# 張嘉幃

## 問題一
```Arduino=
void setup()
{
  pinMode(6, OUTPUT); //告訴 Arduino 6 號腳要輸出
  pinMode(5, OUTPUT); //告訴 Arduino 5 號腳要輸出
  pinMode(3, OUTPUT); //告訴 Arduino 3 號腳要輸出
}

void loop()
{
  digitalWrite(6, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(5, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(3, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(6, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(5, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(3, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
}
```
## 問題二
- 將秒數增加即可。
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  
}
void loop()
{
  if((millis() - before_time1) > 1000)
  {
    before_time1 = millis(); //把 "沙漏" 的時間記下來
    digitalWrite(6, HIGH);
  }
  if((millis() - before_time2) > 2000)
  {
    before_time2 = millis();
    digitalWrite(5, HIGH);
  }
  if((millis() - before_time3) > 3000)
  {
    before_time3 = millis();
    digitalWrite(3, HIGH);
  }
}
```
## 問題三
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
    //當按下開關時， digitalRead(13) 就會從 "0" 變成 "1"
    //digitalRead(13)==0 不成立，所以不會跑 {} 裡面的內容。
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
  digitalWrite(3, LOW);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  
}
```

## 問題四

# 王宇森
## 問題一
![](https://i.imgur.com/xXkChzR.jpg)
## 問題二
![](https://i.imgur.com/uuBweMm.jpg)
## 問題三
![Uploading file..._3qfskbf6a]()

# 王品超
## 問題一
```Arduino=
void setup()
{
  pinMode(6, OUTPUT); 
  pinMode(5, OUTPUT); 
  pinMode(3, OUTPUT); 
}

void loop()
{
  digitalWrite(6, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(5, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(3, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(6, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(5, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(3, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
}
```
## 問題二
![](https://i.imgur.com/PTnYZLx.png)
從問題一去看

## 問題三
```Arduino=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
{
  while(digitalRead(13)>0)
  {
    digitalWrite(6, LOW);
    digitalWrite(5, LOW);
    digitalWrite(3, LOW);
  
}
}
```

# 王浚瑋
# 何振瑋
# 佟聖民
## 問題一
![](https://i.imgur.com/eahcouU.png)
❤→💚→💙
## 問題二
![](https://i.imgur.com/YYjTjs6.png)
剛開始先將紅燈點亮❤(Higt)1秒後熄滅(Low)之後將綠燈點亮💚(Higt)1秒後熄滅(Low)最後將藍燈點亮💙(Higt)1秒後熄滅(Low)
## 問題三
![](https://i.imgur.com/ZU2I5wv.png)

# 吳建興
# 李兆鈞
## 問題一
![](https://i.imgur.com/P1h1A5h.png)
## 問題二
![](https://i.imgur.com/yWyjbfH.png)
## 問題三
# 卓育緯
## 問題一
```C=
//
void setup()
{
  pinMode(6, OUTPUT); //告訴 Arduino 6 號腳要輸出
  pinMode(5, OUTPUT); //告訴 Arduino 5 號腳要輸出
  pinMode(3, OUTPUT); //告訴 Arduino 3 號腳要輸出
}

void loop()
{
  digitalWrite(6, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(3, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  digitalWrite(3, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
}
```
## 問題二
![](https://i.imgur.com/t5MiGbs.png)
## 問題三
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
```
# 張益嘉
## 問題一
![](https://i.imgur.com/yjwPbqE.png)
## 問題二
![](https://i.imgur.com/YDym5On.png)
## 問題三
```C=
int time1=0
int time2=0
int time3=0
voidsetup()
{
pinMode(6,output)
pinMode(5,output)
pinMode(3,output)
pinMode(13,input)
}
voidloop()
{
while(digitalread(13)==0)
{
if((millis()-time1)>1000)
{
time1=millis()
digitailWrite(5,HIGH)
}
if((millis()-time2)>2000)
{
time1=millis()
digitailWrite(3,HIGH)
}
if((millis()-time3)>3000)
{
time1=millis()
digitailWrite(6,HIGH)
}
while(digitalread(13)>0)
digitalWrite(5,LOW)
digitalWrite(6,LOW)
digitalWrite(3,LOW)
}
```
# 莊秉達
## 問題一
![](https://i.imgur.com/7jd0fOM.png)


## 問題二

![](https://i.imgur.com/2rMFFn8.png)
![](https://i.imgur.com/PuLp5WE.png)

## 問題三
![](https://i.imgur.com/G118Yi8.png)

![](https://i.imgur.com/Jb9XDxb.png)




# 游英詮
## 問題一
![](https://i.imgur.com/bmsQCQJ.png)
## 問題二
![](https://i.imgur.com/MUxtlpm.png)
## 問題三
![](https://i.imgur.com/TRKq8ei.png)
# 黃柏瑋
## 問題一
![](https://i.imgur.com/QUOgCwW.png)
## 問題二
![](https://i.imgur.com/cZVsv3k.png)
## 問題三
![](https://i.imgur.com/81K1qHJ.png)
# 黃葆祥
## 問題一
![](https://i.imgur.com/UGYdJk5.png)
## 問題二
![](https://i.imgur.com/0HoALZM.png)
## 問題三
![](https://i.imgur.com/wP4lml2.png)
# 詹政翰
# 趙子瑋
## 問題一
![](https://i.imgur.com/PrJa06X.png)

## 問題二
![](https://i.imgur.com/gvV67dc.png)

## 問題三
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
  // 可以在這邊 "加" 東西在下面，請考慮 digitalRead(13) 是在做什麼
  
}
```
# 謝佳恩
## 問題一
![](https://i.imgur.com/om6UXhR.png)
## 問題二
![](https://i.imgur.com/REceFqj.png)
## 問題三
![](https://i.imgur.com/lO1zbJg.png)

# 謝宸緯
# 王嬿婷
## 問題一
![](https://i.imgur.com/9qEKebj.png)
## 問題二
![](https://i.imgur.com/i9T2WVm.png)
![](https://i.imgur.com/O6meV7X.png)
## 問題三
![](https://i.imgur.com/7rAalIi.png)
![](https://i.imgur.com/nkxVGlm.png)

# 阮翊瑄
## 問題一
![](https://i.imgur.com/fYf3oIh.png)
## 問題二
![](https://i.imgur.com/nVnBqIE.png)
![](https://i.imgur.com/jezGazT.png)

## 問題三
![](https://i.imgur.com/ExTD3Dk.png)
![](https://i.imgur.com/I5xAwCk.png)
# 卓宛廷
# 林宜亭
## 問題一
![](https://i.imgur.com/1sWJdZ2.png)
## 問題二
![](https://i.imgur.com/SiIiJD5.png)
## 問題三
![](https://i.imgur.com/PAmOmxZ.png)
# 金以恩
# 張佳渝
# 張書瑜
## 問題一
![](https://i.imgur.com/HmjGxUx.png)
## 問題二
![](https://i.imgur.com/zX3zqsv.png)
## 問題三
![](https://i.imgur.com/ozNX6rr.png)
# 張景雯
## 問題一
![](https://i.imgur.com/GLwr3la.png)
## 問題二
![](https://i.imgur.com/WOP4edw.png)
## 問題三
![](https://i.imgur.com/jKfVO91.png)
# 陳宜佑
## 問題一
![](https://i.imgur.com/s1G6g7k.jpg)
## 問題二
![](https://i.imgur.com/CKMi1VQ.png)
## 問題三
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis(
```
# 陳怡君
## 問題一
![](https://i.imgur.com/4oDuV6i.png)
## 問題二
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;
void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  
}
void loop()
{
  if((millis() - before_time1) > 1000)
  {
    before_time1 = millis(); //把 "沙漏" 的時間記下來
    digitalWrite(6, HIGH);
  }
  if((millis() - before_time2) > 2000)
  {
    before_time2 = millis();
    digitalWrite(5, HIGH);
  }
  if((millis() - before_time3) > 3000)
  {
    before_time3 = millis();
    digitalWrite(6, HIGH);
    delay(1000);//Wait for 1000 millisecond(s)
    digitalWrite(5, Low);
    delay(1000);//Wait for 1000 millisecond(s)
    digitalWrite(3, Low);
    delay(1000);//Wait for 1000 millisecond(s)
  }
}
```
## 問題三
```C=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
{
  while(digitalRead(13)>0)
  {
    digitalWrite(6, LOW)
    digitalWrite(5, LOW)
    digitalWrite(3, LOW)
  }
}
}
```
# 陳芳俞

## 問題一
![](https://i.imgur.com/c2KUryi.png)
```Arduino=
void setup()
{
  pinMode(6, OUTPUT); //告訴 Arduino 6 號腳要輸出
  pinMode(5, OUTPUT); //告訴 Arduino 5 號腳要輸出
  pinMode(3, OUTPUT); //告訴 Arduino 3 號腳要輸出
}

void loop()
{
  digitalWrite(6, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(5, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(3, HIGH);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(6, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(5, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
  digitalWrite(3, LOW);
  delay(1000); // Wait for 1000 millisecond(s)
}
```
## 問題二
![](https://i.imgur.com/UGgEilt.png)
加分題:
利用問題一，可以讓問題二的燈泡個別發亮。但在做逐個熄滅時，當第一次逐個熄滅後，第二次開始就不會逐個亮起，但依舊會逐個熄滅。

## 問題三
```Arduino=
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
{
  while(digitalRead(13)>0)
  {
    digitalWrite(6, LOW);
    digitalWrite(5, LOW);
    digitalWrite(3, LOW);
  }
}
}
```
# 陳彥臻
## 問題一
![](https://i.imgur.com/Tx8CFWU.png)
## 問題二
![](https://i.imgur.com/gBdP9tI.png)
## 問題三
![](https://i.imgur.com/rdurIU2.png)
# 陳微涵
## 問題一
![](https://i.imgur.com/MoINvPN.png)
## 問題二
![](https://i.imgur.com/ndncPSb.png)
## 問題三
![](https://i.imgur.com/7ZCM8u4.png)
# 楊韻柔
## 問題一
```
//
void setup()
{
  pinMode(6, OUTPUT); //告訴 Arduino 6 號腳要輸出
  pinMode(5, OUTPUT); //告訴 Arduino 5 號腳要輸出
  pinMode(3, OUTPUT); //告訴 Arduino 3 號腳要輸出
}

void loop()
{
  digitalWrite(6, HIGH);
   delay(1000); 
  digitalWrite(5, HIGH);
   delay(1000); 
  digitalWrite(3, HIGH);
  delay(1000); 
  digitalWrite(6, LOW);
   delay(1000); 
  digitalWrite(5, LOW);
   delay(1000); 
  digitalWrite(3, LOW);
  delay(1000);
}
```
## 問題二
```
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  
}
void loop()
{
  if((millis() - before_time1) > 1000)
  {
    before_time1 = millis(); //把 "沙漏" 的時間記下來
    digitalWrite(6, HIGH);
  }
  if((millis() - before_time2) > 2000)
  {
    before_time2 = millis();
    digitalWrite(5, HIGH);
  }
  if((millis() - before_time3) > 3000)
  {
    before_time3 = millis();
    digitalWrite(3, HIGH);
  }
}
```

## 問題三
```
pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
}
{
  while(digitalRead(13)>0)
  {
    digitalWrite(6,LOW);
    digitalWrite(5,LOW);
    digitalWrite(3,LOW);
  }
}

```
# 廖振妤

## 問題一
![](https://i.imgur.com/5Zp7Noe.png)
## 問題二
![](https://i.imgur.com/DLlBVoY.png)
![](https://i.imgur.com/Q6cH1hW.png)
## 第三題
![](https://i.imgur.com/byQEkqZ.png)
![](https://i.imgur.com/HStkUYE.png)




# 褚温蒂
# 趙姿宇
## 問題一
![](https://i.imgur.com/OdKbEKF.png)

## 問題二
![](https://i.imgur.com/ZhbUClJ.jpg)

## 問題三
![](https://i.imgur.com/nqlYhWj.png)

# 劉倢伶
## 問題一
![](https://i.imgur.com/GzrXToG.png)
## 問題二
![](https://i.imgur.com/enOpM7w.png)
## 問題三
![](https://i.imgur.com/YTgWRPZ.png)




# 薛宇柔
## 問題一
```// C++ code
//
void setup()
{
  pinMode(6, OUTPUT); //告訴 Arduino 6 號腳要輸出
  pinMode(5, OUTPUT); //告訴 Arduino 5 號腳要輸出
  pinMode(3, OUTPUT); //告訴 Arduino 3 號腳要輸出
}

void loop()
{
  digitalWrite(6, HIGH);
   delay(1000); 
  digitalWrite(5, HIGH);
   delay(1000); 
  digitalWrite(3, HIGH);
  delay(1000); 
  digitalWrite(6, LOW);
   delay(1000); 
  digitalWrite(5, LOW);
   delay(1000); 
  digitalWrite(3, LOW);
  delay(1000);
}
```
## 問題二
```int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  
}
void loop()
{
  if((millis() - before_time1) > 1000)
  {
    before_time1 = millis(); //把 "沙漏" 的時間記下來
    digitalWrite(6, HIGH);
  }
  if((millis() - before_time2) > 2000)
  {
    before_time2 = millis();
    digitalWrite(5, HIGH);
  }
  if((millis() - before_time3) > 3000)
  {
    before_time3 = millis();
    digitalWrite(3, HIGH);
    delay(1000); 
    digitalWrite(6, LOW);
    delay(1000); 
    digitalWrite(5, LOW);
    delay(1000); 
    digitalWrite(3, LOW);
    delay(1000); 
   }
}  
```
在嘗試將燈泡個別熄滅時，我試過把HIGH改成LOW，但還是沒辦法熄滅，所以就試著用問題一的方式，結果就成功了：）
> 這解法不只一種 :)[color=RED][name=Zhang Jiawei]

## 問題三
```
int before_time1 = 0; //回報 "過" 的時間的變數，預設為 0
int before_time2 = 0; 
int before_time3 = 0;

void setup()
{
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
}

void loop()
{
  while(digitalRead(13)==0) //這行的意思是在 digitalRead 讀到 "0" 時
    //會一直跑 {} 裡面的內容
  {
    if((millis() - before_time1) > 1000) //millis - time = 時間差
    {
      before_time1 = millis(); //把 "沙漏" 的時間記下來
      digitalWrite(6, HIGH);
    }
    if((millis() - before_time2) > 2000)
    {
      before_time2 = millis();
      digitalWrite(5, HIGH);    
    }
    if((millis() - before_time3) > 3000)
    {
      before_time3 = millis();
      digitalWrite(3, HIGH);
    }
  }
{
  while(digitalRead(13)>0)
  {
    digitalWrite(6, LOW);
    digitalWrite(5, LOW);
    digitalWrite(3, LOW);
  }
}
```