Difference between revisions of "ElectroBlocks-archive-sept-2025/C2/Control-LED-with-Push-button/English"
Pratiknemane (Talk | contribs) |
m (Madhurig moved page ElectroBlocks/C2/Control-LED-with-Push-button/English to ElectroBlocks-archive-sept-2025/C2/Control-LED-with-Push-button/English without leaving a redirect) |
(No difference)
| |
Latest revision as of 12:40, 3 September 2025
Title of the Script:Control LED with Push button
Author: Pratik Nemane
Keywords: Electroblocks, arduino board, 220 ohm resistor, LEDs, breadboard, Push button, video tutorial, spoken tutorial.
| Visual Cue | Narration |
| Slide 1:
Title slide. |
Welcome to the Spoken Tutorial on Control LED with Push button using Electroblocks. |
| Slide 2:
Learning Objective |
In this tutorial, we will learn how to,
|
| Slide 3:
System Requirements |
To record this tutorial, I am using:
A working internet connection to use Electroblocks. |
| Slide 4:
Prerequisite |
To follow this tutorial,
|
| Open Google Chrome browser.
|
Let us open the Electroblocks platform using Google Chrome browser.
|
| Click on the New File/Blank File icon.
|
Click on the New File/Blank file option available on the toolbar.
|
| Point towards the loop block.
|
A default loop block appears on the screen.
|
| Add the entire Output video.mp4 in the main video at the 1:29 timestamp. | We will create this Control LED with Push Button output.
|
| Main Video.mp4
|
First we need an If then else block.
|
| Click on Sensor
|
We require a button to control the LED.
|
| Point the cursor towards all three blocks.
|
You will see three blocks.
|
| Point towards “Connected to PIN#”
|
By default, this button is connected to pin 2 of Arduino.
|
| Point the cursor to the “Is Button Pressed” checkbox.
|
By default, the "Is Button Pressed" checkbox in the button setup is always checked.
It means that the button will be in the pressed state when you run the simulation. |
| Point towards the “Loop Dropdown”
|
Observe the loop dropdown option in the Button Setup block.
|
| Point to Copy All option.
|
You can see a checkbox against the Copy all option in the Button setup block.
Check the Copy All checkbox. This setting ensures that the button setup stays the same, for all the loops in the simulation. |
| Only narration
|
We will add a button block in the loop.
|
| Only narration.
|
Now we will add an LED to the circuit.
|
| Click on the LED option.
|
Click on the LED option.
You will see that two LED blocks will appear.
|
| Point to the grey area.
|
You will see that the LED and button setup block will turn to grey.
|
| Point towards the LED and push button.
|
This is an error.
|
| Click on the dropdown arrow in the LED block.
|
Click on the dropdown arrow in the LED block.
|
| Only narration.
|
Let’s make sure that the LED remains turned ON for a sufficient amount of time.
|
| Drag and drop the Wait block for 0.2 second block in the working area.
|
Drag and drop the Wait block for 0.2 second block to the working area.
|
| Only narration.
|
Now we will turn OFF the LED.
|
| Drag and place this new block inside the else section of If then else block.
|
Drag and place this new block inside the else section of If then else block.
|
| Only narration.
|
Now we will see the arduino code generated by electroblocks.
|
| Highlight Pin 4 line of code. | In the void setup function, you will see pin 2 and pin 4 are mentioned.
|
| Point to OUTPUT
|
It is termed as OUTPUT because the arduino gives a value to the LED.
|
| Point to the void loop function.
|
This is the void loop function.
This line checks if the button connected to pin 2 is pressed or not.
This line describes the LED connected to pin 4 turn ON.
|
| Highlight delay(2000) line of code.
|
delay(2000)
This line makes sure that the LED is turned ON for 2 seconds.
If the condition is false, the code inside the else block will execute
This line describes the LED connected to pin 4 turns OFF.
|
| Let’s check the desired result using the simulator. | |
| Click on Home page
|
Click on the Home page option from the toolbar.
|
| Show the LED is turned ON.
|
The visual representation of the simulation shows that:
When the push button is pressed, the LED is turned ON for 2 seconds.
|
| Only narration
|
For this condition, uncheck the Is button pressed checkbox in the button setup block.
|
| Only narration.
|
To see the simulation in the step by step manner.
|
| Click on the Next step
|
Click on the Next Step button and notice the blocks in the working area.
|
| Add the entire Output video.mp4 in the main video at the 10:21 timestamp. | Notice the output of the experiment. |
| This brings us to the end of this tutorial.
| |
| Slide 5:
Summary
|
|
| Slide 6:
Assignment
Hint- Don't use a time block.
|
As an assignment, please do the following:
|
| Add the Assignment video.mp4 in the main video at 10:54 timestamp. | Notice the output of the assignment shown in the video. |
| Slide 7:
Thank you |
This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.
Thank you for watching. |