จัดทำโดย
1.นายไพศาล คิ้มเข้ม
2.นายพิพัฒน์ ดีดศรี
วัสดุอุปกรณ์
1.บอร์ดทดลอง Arduino UNO R3 1 บอร์ด
2.สาย USB 1 เส้น
3.ตัวต้านทาน 150โอหม์ 8 ตัว
4.สายไฟ 9 เส้น
5. หลอด LED 8 หลอด
6.โฟโต้บอร์ด 1 แผง
รูปวงจร
code
int led02 = 2;
int led03 = 3;
int led04 = 4;
int led05 = 5;
int led06 = 6;
int led07 = 7;
int led08 = 8;
int led09 = 9;
void setup() {
pinMode(led02, OUTPUT);
pinMode(led03, OUTPUT);
pinMode(led04, OUTPUT);
pinMode(led05, OUTPUT);
pinMode(led06, OUTPUT);
pinMode(led07, OUTPUT);
pinMode(led08, OUTPUT);
pinMode(led09, OUTPUT);
}
void loop() {
digitalWrite(led02, HIGH);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, HIGH);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, HIGH);
digitalWrite(led04, HIGH);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, HIGH);
digitalWrite(led04, HIGH);
digitalWrite(led05, HIGH);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, HIGH);
digitalWrite(led04, HIGH);
digitalWrite(led05, HIGH);
digitalWrite(led06, HIGH);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, HIGH);
digitalWrite(led05, HIGH);
digitalWrite(led06, HIGH);
digitalWrite(led07, HIGH);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, HIGH);
digitalWrite(led06, HIGH);
digitalWrite(led07, HIGH);
digitalWrite(led08, HIGH);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, HIGH);
digitalWrite(led07, HIGH);
digitalWrite(led08, HIGH);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, HIGH);
digitalWrite(led08, HIGH);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, HIGH);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, HIGH);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, HIGH);
digitalWrite(led08, HIGH);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, HIGH);
digitalWrite(led07, HIGH);
digitalWrite(led08, HIGH);
digitalWrite(led09, HIGH);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, HIGH);
digitalWrite(led06, HIGH);
digitalWrite(led07, HIGH);
digitalWrite(led08, HIGH);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, HIGH);
digitalWrite(led05, HIGH);
digitalWrite(led06, HIGH);
digitalWrite(led07, HIGH);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, HIGH);
digitalWrite(led04, HIGH);
digitalWrite(led05, HIGH);
digitalWrite(led06, HIGH);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, HIGH);
digitalWrite(led04, HIGH);
digitalWrite(led05, HIGH);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, HIGH);
digitalWrite(led04, HIGH);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, HIGH);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, HIGH);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
digitalWrite(led02, LOW);
digitalWrite(led03, LOW);
digitalWrite(led04, LOW);
digitalWrite(led05, LOW);
digitalWrite(led06, LOW);
digitalWrite(led07, LOW);
digitalWrite(led08, LOW);
digitalWrite(led09, LOW);
delay(300);
}