Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the learnpress domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u921920776/domains/makerscientist.com/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the meta-box domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u921920776/domains/makerscientist.com/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the webappick-pdf-invoice-for-woocommerce domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u921920776/domains/makerscientist.com/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the learnpress domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u921920776/domains/makerscientist.com/public_html/wp-includes/functions.php on line 6114

Notice: Undefined index: m-reset-pw in /home/u921920776/domains/makerscientist.com/public_html/wp-content/plugins/easy-login-woocommerce/includes/class-xoo-el-form-handler.php on line 21

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the gotmls domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u921920776/domains/makerscientist.com/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpforms-lite domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u921920776/domains/makerscientist.com/public_html/wp-includes/functions.php on line 6114

Notice: Undefined index: page_shop in /home/u921920776/domains/makerscientist.com/public_html/wp-content/plugins/woo-custom-filter-widget/WOO_CUSTOME_FILTER_Core.php on line 243
I am Roboscientist Grade 8 - Maker Scientist
Notice: Undefined index: ao-pages in /home/u921920776/domains/makerscientist.com/public_html/wp-content/plugins/easy-login-woocommerce/includes/class-xoo-el-frontend.php on line 77

Notice: Undefined index: ao-enable in /home/u921920776/domains/makerscientist.com/public_html/wp-content/plugins/easy-login-woocommerce/includes/class-xoo-el-frontend.php on line 84

Notice: Undefined index: ao-delay in /home/u921920776/domains/makerscientist.com/public_html/wp-content/plugins/easy-login-woocommerce/includes/class-xoo-el-frontend.php on line 69

Course

Elaborate 2: Scattering Pattern with LEDs

Objective:

Blink Five LED in scattering Pattern

Schematics:

Connections:

Reference Picture:

Ardublock

Click on Ardublock to open the Ardublock window and put the following blocks together.

Arduino Code

void setup(){
    pinMode(2,OUTPUT);  //Set pins D2 to D6 as outputs
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
    pinMode(6,OUTPUT);
}
void loop(){
    digitalWrite(4,HIGH); //Turn ON middle LED
    delay(1000);    
    digitalWrite(3,HIGH); //Turn ON next 2 LEDs
    digitalWrite(5,HIGH);
    delay(1000);          
    digitalWrite(2,HIGH);  //Turn ON next 2 LEDs
    digitalWrite(6,HIGH); 
    delay(1000);
    digitalWrite(2,LOW);   //Turn OFF all LEDs
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    delay(1000);
}

Output

Upload the following program on Arduino after connecting the Arduino to laptop and making changes in board and port tab, you will see the 5 LED in scattering pattern

Explanation:

We start by lighting only the center LED. Then we turn on its neighbors. Then we light the end LEDs. The we switch everything off and repeat the step over.

Leave a Reply