ElectroBlocks/C2/Introduction-to-Electroblocks/English

From Script | Spoken-Tutorial
Jump to: navigation, search

Title of the Script: Introduction to Electroblocks

Author: Pratik Bhosle

Keywords: Electroblocks, Arduino, block coding, sensors, LED, RGB LED, spoken tutorial, video tutorial.


Visual Cue Narration
Slide 1


Title Slide

Welcome to the Spoken Tutorial on Introduction to Electroblocks.
Slide 2


Learning Objectives

In this tutorial, we will learn about:


  • How to use Electroblocks user interface to learn block coding.
  • Default blink an LED experiment.
  • How to change component parameters.


Slide 3


System Requirements

To record this tutorial, I am using:
  • Ubuntu Linux OS version 22.04
  • Google Chrome Web browser.


A working internet connection to use Electroblocks.

Slide 4


Prerequisites

To follow this tutorial, learner should have a basic knowledge of:
  • Electronic components.


Slide 5


About Electroblocks

Now we will learn about Electroblocks.
  • ElectroBlocks is a free and open source platform to simulate Arduino experiments.
  • It is designed to introduce users to electronics, coding and Arduino projects.


Slide 6


About Electroblocks

  • It is a tool designed to create electronic circuits using block-based methods.
Slide 7

Features of Electroblocks

  • Electroblocks platform allows us to create code through block-based interfaces.
  • It generates automatic Arduino code to simplify programming for beginners.
  • This makes it easier for non-programmers to get started.
Slide 8


Features of Electroblocks

  • This platform helps users to visualize circuit wiring and code execution.
  • It also allows the user to upload the generated code to the Arduino hardware.
Let’s open the Electroblocks website using Google Chrome browser.

We recommend using Google Chrome for full access to all ElectroBlocks features.

Open browser


Type https://electroblocks.org/

Highlight the link in the search tab

In the search bar, type https://electroblocks.org/ as shown and press the Enter key.


This will take you to the homepage of the Electroblocks website.

Point to the interface. Let us see the user interface of the Electroblocks platform.
Hover the cursor through these options

Click on the Add-ons tab.

Click on the Sensors tab,

On the left hand side of your screen various programming blocks are available.

For example, Logic, Loops, Math, Message, Time, etc.

Below you can see the Add-ons and Sensors tab.

Click on the Add-ons tab to see a list of different components.

For example, Bluetooth, LCD, LED, Motor and others.

Similarly, click on the Sensors tab, to see a list of various sensors.

For example, Analog, Digital, Motion, Temperature and others.


Users can design their own Arduino projects using drag-and-drop block programming interface.

Highlight Arduino connection with breadboard using a box

Point to the simulation button

On the right side, a blink of an LED project can be seen.

A Play button is available below the Simulation window to start the simulation.

Play the Simulation Click on the Play button to start the simulation.

Notice the pattern of LED turning ON and OFF after a certain interval of time.

Use the step by step button to show the simulation This platform provides a feature to view step by step execution of the code.

Let's begin the simulation from the start.

The square box represents the simulation status.

Let's drag this box to the start point of the simulation, as shown here.

Now, click the Next Step button.

Observe the block section of the window. The currently executed block will be highlighted in yellow.

Notice the status window below the simulation window.

The block that is currently executed is highlighted in the status window.

Click on the Code Icon Click on the Code Icon available on the toolbar at the top.

A window with Arduino compatible code appears on the screen.

Electroblocks and its Arduino compatible code can be seen together.

This Arduino code is generated automatically by the Electroblocks.

This is the basic format of an Arduino code.

Void setup function includes sensors, components and their connection to the Arduino board.

Void Setup function shows if the sensor used in the experiment is for input or output.

The void loop function shows the actions performed by the components and sensors.

Point to the block.

Point to pin 13 on the block.

Highlight Block section


Highlight Arduino code section

Change the LED pin number

Highlight the entire Arduino code

Let's now change the parameters of the LED components in the block.

The LED connected to pin 13 of the Arduino has two blocks, to represent its two states.

These blocks indicate two states as LED ON and LED OFF.


While changing the LED's parameters, ensure that you update the pin number of both the LED blocks.

Let us change the LED pin connected to the Arduino board.

Click on the pin 13 dropdown menu and change the pin number to pin 10.

Click the dropdown menu of the other block and change the LED pin to pin 10.

Observe that changes made in the block section are also reflected in the code section.

Change the Time delay We can change the delay time of LED turning ON and turning OFF.

Click on the seconds block and enter 2 as shown.

This change will ensure the LED will remain ON for 2 seconds.

Perform the same step for the second time delay block as well.

The delay time changes in the Arduino code after changing the time block in the block section.

Show LED color palette Users can also change the color of the LED.

Click on the color icon to change the color of the LED.

Click the blue color box to change the LED color to blue.

Notice the change in the color of both the blocks.

Click on Home button Let us now switch to the home page by clicking on the Home button.


Notice that the LED is connected to pin 10 of the Arduino.

Simulation Now, we will simulate this experiment to notice the changes we have made.

Click on the Play button to start the simulation.


First of all, the LED is now connected to pin 10 of Arduino.


Secondly, notice the turn ON and turn OFF time of the LED.


You can see the LED is turned ON for 2 seconds and it is turned OFF for 2 seconds.

Click on the Download icon Let us see how to download and save the project.


This is the Download icon, click on it.

Click on the Download Project button.


Click on the Download Code option.

Point to the .ino file.

Users can download the entire project or only Arduino code.


If the user wants to download the project file, click on the Download Project button.


This project file will contain programming blocks, circuit diagram and Arduino code.

If the user wants to download only the Arduino code, click on the Download Code option.


The code will be downloaded as an .ino file.

Click on the Download Project option. Let us download this experiment’s project file and save it in our local system.

Click on the Download Project option.

The system will ask to choose the directory and give the name to the file.

Let us save this file in the Downloads directory and name it Blink of LED.


The file will be downloaded as an .xml format.


Click on the Home button as shown.

Click on New File/Blank File Icon.

Click on the OK button.

Click on the New File/Blank File option to open a blank project on the screen.


A pop-up window will ask you for permission to open a blank file.


Click on the OK button.


Notice there are no blocks in the working area.


Also, there is no circuit diagram on the right hand side of your screen.

Click on the Projects icon available on the toolbar. Click on the Projects icon available on the toolbar.

The Projects window appears on the right side of your screen.

In this window, you will find various demo projects.


These projects will help users to get familiar with the ElectroBlocks.


Electroblocks platform also provides an option to open a project from your local system.

Click on Open a project from your computer option.

Click on the Downloads directory.

Select Blink of LED.xml file and click on Open button.

Click on the OK button.

Let us open the blink of an LED experiment which we just saved in our system.


Click on Open a project from your computer option.


The system will ask to choose the directory for the upload file.


Click on the Downloads directory.


Select Blink of LED.xml file and click on Open button.


A pop-window will appear on the screen to confirm if you want to open a new file.


Click on the OK button.


The blink of an LED project appears on the screen.

This brings us to the end of this tutorial.


Let us summarize.

Slide 9


Summary

In this tutorial, we learnt about
  • How to use Electroblocks user interface to learn block coding.
  • Default blink an LED experiment.
  • How to change component parameters.


Slide 10


Assignment

As an assignment, please do the following
  • Change the color of the LED to Green.
  • Connect the LED at pin 8 of the Arduino.
  • Change the delay time to 3 seconds and simulate the circuit.
Slide 11


About Spoken Tutorial project

The video at the following link summarizes the Spoken Tutorial project.

Please download and watch it.

Slide 12


Spoken Tutorial workshops

The Spoken Tutorial Project Team conducts workshops and gives certificates.

For more details, please write to us.

Slide 13


Answers for THIS Spoken Tutorial


  • Do you have questions in THIS Spoken Tutorial?
  • Please visit this site.Choose the minute and second where you have the question.
  • Explain your question briefly .The spoken tutorial project will ensure an answer.
  • You will have to register to ask questions.
Slide 14


Forum for specific questions

  • The Spoken Tutorial forum is for specific questions on this tutorial.
  • Please do not post unrelated and general questions on them.
  • This will help reduce the clutter.
  • With less clutter, we can use these discussions as instructional material.
Slide 15


Acknowledgement

Spoken Tutorial project was established by the Ministry of Education(MoE), Govt of India.
Slide 16


Thank you

This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.


Thank you for watching.

Contributors and Content Editors

Madhurig, Nirmala Venkat