Step 1: Prepare 準備材料
- 兩個LED燈(自行選色)
- 兩個電阻
- Arduino Leonardo
- 麵包板
- 三條電線
- USB連接埠
- 裝飾物蓋住LED燈泡(如果想做成夜燈類)
Step 2: 組裝
Step 3: Download or Copy Code to Arduino App 下載或是複製程式碼到Arduino程式
// the setup function runs once when you press reset or power the board |
|
void setup() |
{ |
// initialize digital pin 13 as an output. |
pinMode(13, OUTPUT); |
pinMode(11, OUTPUT); //輸入另一個LED |
int analogPin = 0; |
} |
|
// the loop function runs over and over again forever |
void loop() |
{ |
|
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) |
digitalWrite(11, LOW);//讓另一個LED暗 |
delay(1000); // wait for a second |
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW |
digitalWrite(11, HIGH);//讓另一個LED亮 |
delay(1000); // wait for a second |
} |
Step 4: Connect Arduino Board to Computer 將arduino版接上電腦
Step 5: 完成啦~~~~~
Be the First to Share
Did you make this project? Share it with us!
Recommendations
Clocks Contest

Block Code Contest

Baking Contest

Comments
2 years ago
Congratulations on your first instructable :) What revision did you make to the original project ?