Description
⚫ Data :https://docs.google.com/presentation/d/10ZMcQxYtCXkrXLtKLX
Vb12kVCReyMAF0/edit?fbclid=IwAR3pleVvyN-
4VqH7BsrvsYb4qna0XRQa3WoiM30j5vhG9pdyCmiEZYeK_uU#slide=id. p1
⚫ 影片: https://youtu.be/fjocqiF3gZE
⚫ 基本題 (70%):
◼ 題目敘述: 請連接一個按鈕在 RB0 腳位作為開關,並分別連接四個燈泡在 RA0~RA3 腳位。燈泡的變化會如同下圖所示。
◼ 評分標準:
1. 請將按鈕與燈泡連接在題目要求的腳位上。
⚫ 進階題 (30%):
◼ 題目敘述: 請連接一個按鈕在 RB0 腳位作為開關,並分別連接四個燈泡在 RA0~RA3 腳位。燈泡的變化會如同下圖所示。
1. 請將按鈕與燈泡連接在題目要求的腳位。
2. 請寫一個名為 delay 的 macro 去計算 0.5 秒。
加分題 (20%):
◼ 題目敘述: 請連接一個按鈕在 RB0 腳位作為開關,並分別連接
四個燈泡在 RA0~RA3 腳位。燈泡依照亮的狀態可以分為以下幾種狀態。並依據如下敘述按下按鈕的次數呈現不同順序的狀態。
RA0 RA1 RA2 RA3
A B
CD
E
➢ 按下第一次 a -> 0.5 秒-> b -> 0.5 秒-> c -> 0.5 秒-> d -> 0.5 秒->e
➢ 按下第二次 b -> 0.5 秒-> c -> 0.5 秒-> d -> 0.5 秒-> a -> 0.5 秒->e
➢ 按下第三次 c -> 0.5 秒-> d -> 0.5 秒-> a -> 0.5 秒-> b -> 0.5 秒->e ➢ 按下第四次 d -> 0.5 秒-> a -> 0.5 秒-> b -> 0.5 秒-> c -> 0.5 秒->e
➢ 按下第五次 同第一次
➢ 按下第六次 同第二次 以此類推 ➢ 程式不結束 回到一開始 可繼續判斷按鈕是否按下 ◼ 評分標準:
1. 請將按鈕與燈泡連接在題目要求的腳位。
2. 請寫一個名為 delay 的 macro 去計算 0.5 秒。
⚫ Data :https://docs.google.com/presentation/d/10ZMcQxYtCXkrXLtKLX
Vb12kVCReyMAF0/edit?fbclid=IwAR3pleVvyN-
4VqH7BsrvsYb4qna0XRQa3WoiM30j5vhG9pdyCmiEZYeK_uU#slide=id.
p1
⚫ Video: https://youtu.be/fjocqiF3gZE ⚫ Basic(70%):
◼ Description: Connect a push-button at RB0 port with pull-up or pull-down resistor. Connect four LEDs at RA0 ~ RA3 port. Press the button to change the blinking pattern of LEDs, as in the figure below.
◼ Standard of Grading:
1. Connect all the LEDs and button to the proper ports.
2. The LEDs should change the state after pressing the button.
⚫ Advanced(70%):
◼ Description: Connect a push-button at RB0 port with pull-up or pull-down resistor. Connect four LEDs at RA0 ~ RA3 port. Press the button to change the blinking pattern of LEDs, as in the figure below.
◼ Standard of Grading:
1. Connect all the LEDs and button to the proper ports.
2. The LEDs must work, as the figure shows above.
3. Write a macro named “delay” for blinking for 0.5s.
Bonus(20%):
◼ Description: Connect a push-button at RB0 port with pull-up or pull-down resistor. Connect four LEDs at RA0 ~ RA3 port. Press the button to change the blinking pattern of LEDs, as in the figure below.
RA0 RA1 RA2 RA3
AB
CD
E
➢ First press: a -> 0.5s-> b -> 0.5s-> c -> 0.5s-> d -> 0.5s->e
➢ Second press b -> 0.5s-> c -> 0.5s-> d -> 0.5s-> a -> 0.5s->e
➢ Third press c -> 0.5s-> d -> 0.5s-> a -> 0.5s-> b -> 0.5s->e ➢ Fourth press d -> 0.5s-> a -> 0.5s-> b -> 0.5s-> c -> 0.5s->e ➢ Fifth press: Same as the First press.
➢ Sixth press: Same as the Second press.
◼ Standard of Grading:
1. Connect all the LEDs and button to the proper ports.
2. The LEDs must work, as the figure shows above.
3. Write a macro named “delay” for blinking for 0.5s.
Reviews
There are no reviews yet.