Webduino 模擬器:按鈕控制LED亮滅 (Webduino Simulator: Control a LED with a Button)
1 min readNov 22, 2018
這次換用 Webduino 模擬器上的按鈕來控制 LED 燈。
This tutorial will control a LED with a button.
模擬器的接線方式,為一顆 LED ,長腳接D13,短腳接GND。(注意:實際硬體的LED燈是需要接上電組的,不然LED燈有可能會燒掉。)以及一個按鈕,S接D10,V接5V,G接GND。
Wiring:
- LED anode → UNO D13
- LED cathode → UNO GND
- Button S(signal) → UNO D10
- Button V(voltage) → UNO 5V
- Button G(ground) → UNO GND
The circuit design is the following diagram. (Note: a resistor is needed for physical wiring to avoid destroying a LED.)
程式積木部分為:
The code:
範例網址 (Example URL):https://simulator.webduino.io/#-Kyxg9IBRGE_Wir9kKyZ
影片 (Demo Video):
Originally published at yunlinsong.blogspot.com on November 22, 2018.