<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=ElectroBlocks%2FC2%2FServo-Motor%2FEnglish</id>
		<title>ElectroBlocks/C2/Servo-Motor/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=ElectroBlocks%2FC2%2FServo-Motor%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ElectroBlocks/C2/Servo-Motor/English&amp;action=history"/>
		<updated>2026-05-04T08:30:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ElectroBlocks/C2/Servo-Motor/English&amp;diff=57174&amp;oldid=prev</id>
		<title>Madhurig at 07:35, 11 October 2025</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ElectroBlocks/C2/Servo-Motor/English&amp;diff=57174&amp;oldid=prev"/>
				<updated>2025-10-11T07:35:40Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=ElectroBlocks/C2/Servo-Motor/English&amp;amp;diff=57174&amp;amp;oldid=57142&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Madhurig</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=ElectroBlocks/C2/Servo-Motor/English&amp;diff=57142&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot;{| border=&quot;1&quot; |- || '''Visual Cue''' || '''Narration''' |- || '''Slide 1''' || Welcome to the '''Spoken Tutorial''' on '''Servo Motor '''using '''Electroblocks'''. |- style=&quot;b...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=ElectroBlocks/C2/Servo-Motor/English&amp;diff=57142&amp;oldid=prev"/>
				<updated>2025-10-01T11:26:42Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| border=&amp;quot;1&amp;quot; |- || &amp;#039;&amp;#039;&amp;#039;Visual Cue&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039; |- || &amp;#039;&amp;#039;&amp;#039;Slide 1&amp;#039;&amp;#039;&amp;#039; || Welcome to the &amp;#039;&amp;#039;&amp;#039;Spoken Tutorial&amp;#039;&amp;#039;&amp;#039; on &amp;#039;&amp;#039;&amp;#039;Servo Motor &amp;#039;&amp;#039;&amp;#039;using &amp;#039;&amp;#039;&amp;#039;Electroblocks&amp;#039;&amp;#039;&amp;#039;. |- style=&amp;quot;b...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|| '''Visual Cue'''&lt;br /&gt;
|| '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|| '''Slide 1'''&lt;br /&gt;
|| Welcome to the '''Spoken Tutorial''' on '''Servo Motor '''using '''Electroblocks'''.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide 2:'''&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|| In this tutorial, we will learn to,&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Build a set of blocks to create a''' Servo motor '''experiment&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Check the output of the experiment using the simulator&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide 3:'''&lt;br /&gt;
&lt;br /&gt;
'''System requirement'''&lt;br /&gt;
|| To record this tutorial, I am using&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''Ubuntu Linux OS version 22.04'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''Google Chrome Browser'''&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A working internet connection to use the Electroblocks. &lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide 4:'''&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite'''&lt;br /&gt;
&lt;br /&gt;
|| To follow this tutorial, learner should have a basic knowledge of&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Electroblocks &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Type &lt;br /&gt;
&lt;br /&gt;
'''https://electroblocks.org/'''&lt;br /&gt;
|| Let us open the''' ElectroBlocks''' website using the '''Chrome''' browser.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Only narration&lt;br /&gt;
|| Let us open a new blank project.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Show Circuit Diagram.png'''&lt;br /&gt;
&lt;br /&gt;
Point to the servo motor and then to the button&lt;br /&gt;
|| This is the circuit diagram of '''servo motor experiment.'''&lt;br /&gt;
&lt;br /&gt;
The servo motor will rotate in a specified angle when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
Let us build this circuit using''' ElectroBlocks'''.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide:5'''&lt;br /&gt;
&lt;br /&gt;
Required section&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Logic&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Button &amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Variables&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Loops&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Servo&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Time&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|| We will need the following sections for this experiment.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| &lt;br /&gt;
|| Switch back to the '''Electroblocks''' interface.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Keep the loop block in the middle area (compulsory)'''&lt;br /&gt;
&lt;br /&gt;
Click on the Logic sectionDrag and drop the block in working area&lt;br /&gt;
&lt;br /&gt;
Place the if-then block in the loop section.&lt;br /&gt;
|| Click on the '''Logic''' section.&lt;br /&gt;
&lt;br /&gt;
Select the '''if-then''' block.&lt;br /&gt;
&lt;br /&gt;
Drag and place it inside the '''loop''' block.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Click the '''Sensors''' section and point to lis&lt;br /&gt;
&lt;br /&gt;
Select the '''Button setup''' block and drag it in the working area.&lt;br /&gt;
&lt;br /&gt;
Point to '''pin 2'''&lt;br /&gt;
&lt;br /&gt;
|| Click on the '''Sensors''' section and select the '''Button.'''&lt;br /&gt;
&lt;br /&gt;
Select the '''Button setup''' block and drag it to the working area.&lt;br /&gt;
&lt;br /&gt;
Note that by default the button is connected to '''pin 2''' of the '''Arduino'''.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Select the '''button is pressed''' block and Place this block in the '''if''' section of the '''if-then''' block&lt;br /&gt;
|| Go to the '''Button section.'''&lt;br /&gt;
&lt;br /&gt;
Drag and place the''' button is pressed''' block in the '''if''' section of the '''if-then''' block.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Only narration &lt;br /&gt;
&lt;br /&gt;
Click on the Loops option.&lt;br /&gt;
&lt;br /&gt;
Click on the loop with i block&lt;br /&gt;
&lt;br /&gt;
Drag and place this block in the then section of the if then block.&lt;br /&gt;
&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Click on the &amp;lt;span style=&amp;quot;background-color:transparent;&amp;quot;&amp;gt;'''Loops'''&amp;lt;/span&amp;gt; section.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Drag and place the '''loop with '''block in the '''then''' section of '''if then''' block.&lt;br /&gt;
&lt;br /&gt;
The '''loop with '''block creates a loop with a '''from''' value, '''to''' value and '''increment''' value.&lt;br /&gt;
&lt;br /&gt;
Let us change the '''from''' value as 40 and '''to''' value as 140.&lt;br /&gt;
&lt;br /&gt;
By default the increment value is 1. Let us change to 10.&lt;br /&gt;
&lt;br /&gt;
This loop setup runs from 40 to 140, incrementing the '''I '''variable by 10 each time.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Only narration&lt;br /&gt;
&lt;br /&gt;
Click on the '''Add-ons''' option&lt;br /&gt;
&lt;br /&gt;
Click on the '''Servo''' option.&lt;br /&gt;
|| Next we will add a '''servo motor''' block.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Add-ons''' section and click on the '''Servo'''.&lt;br /&gt;
&lt;br /&gt;
Drag and place the '''Rotate servo''' block in the '''do''' section of the''' loop with '''block.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Only narration&lt;br /&gt;
&lt;br /&gt;
Point to '''servo''' and''' push button''' block&lt;br /&gt;
&lt;br /&gt;
Click on the dropdown arrow in the '''Rotate servo''' block and change the pin number to pin 5&lt;br /&gt;
&lt;br /&gt;
Point to the blocks and the circuit diagram&lt;br /&gt;
|| You will see both the '''Rotate servo''' and '''button setup '''block will turn to grey.&lt;br /&gt;
&lt;br /&gt;
Also, you will not see a circuit in the simulation screen.&lt;br /&gt;
&lt;br /&gt;
This is an error.&lt;br /&gt;
&lt;br /&gt;
It occurs because both the '''servo motor''' and '''push button''' are connected to pin 2 of the Arduino.&lt;br /&gt;
&lt;br /&gt;
To resolve this error, we will assign a different pin number to the '''servo motor.'''&lt;br /&gt;
&lt;br /&gt;
Click on the dropdown arrow in the '''Rotate servo''' block and change the pin number to pin 5 .&lt;br /&gt;
Now, all the blocks appear in normal condition, with the updated circuit diagram.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Point to rotate servo number block &lt;br /&gt;
&lt;br /&gt;
|| We can see the default degree as '''50''' which indicates the servo motor rotates to '''50''' degrees.&lt;br /&gt;
&lt;br /&gt;
Let us set the limit between 40 to 140 degrees.&lt;br /&gt;
&lt;br /&gt;
For that we need to use a variable '''i''' which we defined in the '''loop with '''block.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Remove the Rotate Servo number block&lt;br /&gt;
&lt;br /&gt;
Click on the Variable option on the left-hand side of the screen.&lt;br /&gt;
&lt;br /&gt;
Select the i block and drag it into the working area.&lt;br /&gt;
&lt;br /&gt;
Place the i block inside the Rotate Servo block.&lt;br /&gt;
&lt;br /&gt;
Only narration&lt;br /&gt;
|| First, delete the '''degrees''' block value by selecting the block and press the delete key.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Variable section''' and Select the '''i block'''.&lt;br /&gt;
&lt;br /&gt;
Place the '''i''' '''block''' next to the degrees section of the '''Rotate servo block.'''&lt;br /&gt;
&lt;br /&gt;
It sets the variable i for the '''loop with '''block to work.&lt;br /&gt;
&lt;br /&gt;
Now the servo motor rotates from 40° to 140° when the push button is pressed.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Click on the '''Time''' section&lt;br /&gt;
&lt;br /&gt;
drag and drop the '''Wait for 0.2 seconds '''block and place it below the '''Rotate servo '''block.&lt;br /&gt;
|| The '''delay''' block is required to ensure the servo motor rotates smoothly.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Time''' section.&lt;br /&gt;
&lt;br /&gt;
Drag and drop the '''Wait for 0.2 seconds''' block and place it below the''' Rotate servo''' block.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Only narration&lt;br /&gt;
&lt;br /&gt;
Right click on the loop with i block.&lt;br /&gt;
&lt;br /&gt;
Select the duplicate option.&lt;br /&gt;
&lt;br /&gt;
Place this block below the loop with the i block.&lt;br /&gt;
&lt;br /&gt;
Point to 140 to 40 &lt;br /&gt;
|| We need the servo motor to rotate in the opposite direction when it reaches 140 degrees.&lt;br /&gt;
&lt;br /&gt;
We will duplicate the entire''' loop with '''block and change the values from 140 to 40 degrees.&lt;br /&gt;
&lt;br /&gt;
Right click on the '''loop with''' block and select the '''duplicate''' option.&lt;br /&gt;
&lt;br /&gt;
Place this block below the '''loop with '''block.&lt;br /&gt;
&lt;br /&gt;
Change the '''from''' and '''to''' values as 140 and 40.&lt;br /&gt;
&lt;br /&gt;
Now we have created the blocks required for this experiment.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Only Narration.&lt;br /&gt;
&lt;br /&gt;
Click on '''Code''' '''Icon.'''&lt;br /&gt;
&lt;br /&gt;
'''Zoom and show the code.'''&lt;br /&gt;
|| We will see the '''arduino''' '''code''' generated by '''electroblocks'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Code''' '''icon'''.&lt;br /&gt;
&lt;br /&gt;
The code includes self-explanatory''' comments''' for better understanding.&lt;br /&gt;
&lt;br /&gt;
Click the '''Home''' icon and press the '''Play button''' to start the simulation.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| Point to simulation window.&lt;br /&gt;
&lt;br /&gt;
|| When the push button is pressed, the servo motor rotates from 40 to 140 degrees.&lt;br /&gt;
&lt;br /&gt;
We can see the''' i '''value displayed above the servo motor.&lt;br /&gt;
&lt;br /&gt;
Notice that once it reaches 140-degrees, it will start to rotate in the reverse direction.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| &lt;br /&gt;
|| The '''XML '''file of this experiment is provided in the code files for your reference.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide:5'''&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|| This brings us to the end of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Let us summarize.&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide:6'''&lt;br /&gt;
&lt;br /&gt;
'''Assignment''':&lt;br /&gt;
&lt;br /&gt;
|| As an assignment, please do the following&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Change the parameters to rotate the servo motor from 0° to 180° and rotate back to 0°. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:1pt solid #000000;padding:0.176cm;&amp;quot;&lt;br /&gt;
|| '''Slide 7:'''&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|| Thank you for joining.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>