รูปวงจร
VIDEO
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);
}