<?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=Arduino%2FC2%2FPulse-Width-Modulation%2FEnglish-timed</id>
		<title>Arduino/C2/Pulse-Width-Modulation/English-timed - 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=Arduino%2FC2%2FPulse-Width-Modulation%2FEnglish-timed"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Arduino/C2/Pulse-Width-Modulation/English-timed&amp;action=history"/>
		<updated>2026-04-08T20:00:26Z</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=Arduino/C2/Pulse-Width-Modulation/English-timed&amp;diff=50785&amp;oldid=prev</id>
		<title>PoojaMoolya at 05:50, 23 January 2020</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Arduino/C2/Pulse-Width-Modulation/English-timed&amp;diff=50785&amp;oldid=prev"/>
				<updated>2020-01-23T05:50:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 05:50, 23 January 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 210:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 210:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|04:30&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|04:30&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The '''duty cycle''' value must be between 0 to 255 i.e between &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;0voltz &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;5Voltz&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| The '''duty cycle''' value must be between 0 to 255 i.e between &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;0 volts &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;5 Volts&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PoojaMoolya</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Arduino/C2/Pulse-Width-Modulation/English-timed&amp;diff=50784&amp;oldid=prev</id>
		<title>PoojaMoolya: Created page with &quot; {| border=1 |  '''Time'''  | '''Narration'''   |-  |00:01 | Welcome to the spoken tutorial on '''Pulse Width Modulation.'''   |-  |00:06 | In this tutorial we will learn abou...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Arduino/C2/Pulse-Width-Modulation/English-timed&amp;diff=50784&amp;oldid=prev"/>
				<updated>2020-01-23T05:28:44Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; {| border=1 |  &amp;#039;&amp;#039;&amp;#039;Time&amp;#039;&amp;#039;&amp;#039;  | &amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039;   |-  |00:01 | Welcome to the spoken tutorial on &amp;#039;&amp;#039;&amp;#039;Pulse Width Modulation.&amp;#039;&amp;#039;&amp;#039;   |-  |00:06 | In this tutorial we will learn abou...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{| border=1&lt;br /&gt;
|  '''Time''' &lt;br /&gt;
| '''Narration''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:01&lt;br /&gt;
| Welcome to the spoken tutorial on '''Pulse Width Modulation.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:06&lt;br /&gt;
| In this tutorial we will learn about:  '''PWM i.e Pulse Width modulation''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:13&lt;br /&gt;
| '''PWM Duty Cycle''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:16&lt;br /&gt;
| '''PWM Frequency''' &lt;br /&gt;
&lt;br /&gt;
'''L293D Motor Driver IC''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:24&lt;br /&gt;
| To follow this tutorial, you should have basic knowledge of: &lt;br /&gt;
&lt;br /&gt;
'''Electronics''' and '''C or C++''' programming language &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:35&lt;br /&gt;
| To record this tutorial, I am using &lt;br /&gt;
&lt;br /&gt;
'''Arduino Uno board''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:40&lt;br /&gt;
|  '''Ubuntu Linux 16.04 OS''' &lt;br /&gt;
&lt;br /&gt;
'''Arduino IDE ''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:46&lt;br /&gt;
| We will also require some external '''components''' such as: &lt;br /&gt;
&lt;br /&gt;
'''Breadboard''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|00:53&lt;br /&gt;
| '''10K Ohm Potentiometer''' &lt;br /&gt;
&lt;br /&gt;
'''LED''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:58&lt;br /&gt;
|  '''220 ohm Resistor''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:01&lt;br /&gt;
|  '''Jumper Wires''' &lt;br /&gt;
&lt;br /&gt;
'''Push Button''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:05&lt;br /&gt;
|'''DC Motor''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:08&lt;br /&gt;
| and '''L293D Motor Driver IC''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:14&lt;br /&gt;
| '''PWM signal '''is a square wave signal which has a high frequency i.e '''1KHz'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:22&lt;br /&gt;
|  '''PWM''' is a technique by which the width of the '''pulse''' is varied. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:28&lt;br /&gt;
|  It is done while keeping the frequency of wave constant. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:33&lt;br /&gt;
| '''PWM signal''' consists of two main properties that define its behaviour. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:40&lt;br /&gt;
|  They are '''Duty Cycle''' and '''Frequency.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:44&lt;br /&gt;
| It is the percentage of time, a '''digital signal''' is on, over a period of time. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:50&lt;br /&gt;
| '''Duty cycle''' can be varied from 0% to 100%.. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|01:55&lt;br /&gt;
| The formula to calculate the percentage of '''duty cycle''' is shown here. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:01&lt;br /&gt;
|  '''tON '''is equal to the duration of time when '''signal''' is high. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:06&lt;br /&gt;
| '''tOFF '''is equal to the duration of time when '''signal''' is low. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:11&lt;br /&gt;
|  '''Time Period''' is''' tON + tOFF'''. &lt;br /&gt;
&lt;br /&gt;
i.e. It is equal to the sum of '''on''' time and '''off''' time of '''PWM signal'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:24&lt;br /&gt;
| Frequency determines how fast the '''PWM''' completes a '''cycle'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:29&lt;br /&gt;
|  i.e. How fast it switches from '''HIGH''' to '''LOW''' states. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:34&lt;br /&gt;
|We will perform one simple experiment by varying '''duty cycle'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:39&lt;br /&gt;
| This will control the brightness of '''LED'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:43&lt;br /&gt;
|'''Arduino Uno''' has 6 '''PWM channels.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:48&lt;br /&gt;
| Pins 3, 5, 6, 9, 10, 11 on '''Arduino Uno''' are '''PWM channels.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|02:58&lt;br /&gt;
| '''PWM channels''' are denoted by''' tilde '''sign. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:02&lt;br /&gt;
| Let us see the circuit connection now. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:05&lt;br /&gt;
|Connect '''anode''' leg of the '''LED''' to pin 9 of '''Arduino''' through '''220 ohm resistor.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:13&lt;br /&gt;
| Connect '''cathode''' leg of the '''LED''' to '''ground'''. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|03:17&lt;br /&gt;
| This is the '''live setup''' of the connection. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:20&lt;br /&gt;
| Do the connection as shown in the image. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:23&lt;br /&gt;
| Let us open the''' Arduino IDE'''. &lt;br /&gt;
&lt;br /&gt;
We will write a '''program''' to change the brightness of '''LED''' using '''PWM''' pin. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:32&lt;br /&gt;
| Type the code as shown. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:35&lt;br /&gt;
| We have assigned the '''PWM pin 9''' to the '''variable LED_Pin.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:42&lt;br /&gt;
| We have initialized '''duty_cycle_value''' as 1 for an '''LED''' to turn '''ON'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:51&lt;br /&gt;
| Inside '''void setup''', we will write '''pinMode function'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|03:56&lt;br /&gt;
| We have declared '''pin 9''' of the '''Arduino''' as '''OUTPUT'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:01&lt;br /&gt;
| Inside '''void loop function''' we will write this code. &lt;br /&gt;
&lt;br /&gt;
Let me explain the code. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:08&lt;br /&gt;
| '''While''' loop executes the code till the '''duty_cycle_value''' is below 255. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:17&lt;br /&gt;
| '''analogWrite() function''' is used to generate '''PWM signal'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:22&lt;br /&gt;
| We are passing two '''parameters'''. i.e '''PWM''' pin number and the '''duty cycle''' value. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|04:30&lt;br /&gt;
| The '''duty cycle''' value must be between 0 to 255 i.e between 0voltz and 5Voltz&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:40&lt;br /&gt;
| We will keep a '''delay''' of 3000 millisecond i.e. 3 seconds &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:46&lt;br /&gt;
| Click on the '''compile''' button to verify your '''program'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:51&lt;br /&gt;
| A pop up window will appear to save the current '''program'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|04:55&lt;br /&gt;
| Let us save the '''program''' as '''LED_Brightness '''and click on the '''Save''' button. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:03&lt;br /&gt;
| Now click on '''upload''' button to upload the current '''program''' on '''Arduino''' board.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:09&lt;br /&gt;
| We can see the brightness of '''LED''' increasing gradually. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:15&lt;br /&gt;
| Next, we will do an experiment to control the speed and direction of a '''DC motor.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:22&lt;br /&gt;
| This is the '''pinout''' diagram of '''L293D motor driver IC.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:28&lt;br /&gt;
| The speed of the '''motor''' is controlled by '''EN 1''' and '''EN 2''' of the '''IC'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:36&lt;br /&gt;
| The direction of the '''motor''' is controlled by '''IN1, IN2, IN3, IN4''' of the '''IC'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:45&lt;br /&gt;
| We can control 2 '''motors''' at a time using this '''IC'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:50&lt;br /&gt;
| In our experiment, we will connect only one '''DC motor'''. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
| 05:55&lt;br /&gt;
| Let us see the circuit connection now. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|05:58&lt;br /&gt;
| Pin 1, pin 8 and pin 16 of '''driver IC''' are connected to''' 5V.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:05&lt;br /&gt;
|  Pin 4 and pin 5 of '''driver IC''' are connected to '''ground'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:11&lt;br /&gt;
| Pin 2 and pin 7 of '''driver IC''' are connected to pin 11 and pin 10 of '''Arduino'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:20&lt;br /&gt;
|  2 '''push buttons''' are connected to pin 12 and pin 13 of '''Arduino'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:27&lt;br /&gt;
| These '''push buttons''' are used to control the direction of '''DC motor'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:33&lt;br /&gt;
| '''10Kohm potentiometer''' is connected to control the speed of the '''DC motor'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:39&lt;br /&gt;
| Middle pin of '''potentiometer''' is connected to '''analog''' pin A0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:45&lt;br /&gt;
|  Pin 3 and pin 6 of '''driver IC''' are connected to '''DC motor'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:51&lt;br /&gt;
| Do the connection as shown in the image. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|06:55&lt;br /&gt;
| This is the '''live setup''' of the connection, as shown in the image. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:00&lt;br /&gt;
| I have fixed a wheel on the shaft of the '''motor'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:04&lt;br /&gt;
| This will help to see the rotation and varying speed of '''motor''' clearly. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|07:10&lt;br /&gt;
| Now we will write a '''program''' for this circuit to work. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:14&lt;br /&gt;
| Let’s switch to '''Arduino IDE.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:18&lt;br /&gt;
| Type the code as shown here. &lt;br /&gt;
&lt;br /&gt;
We have initialized the connection between '''Arduino''' and '''driver IC'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:28&lt;br /&gt;
| '''Potentiometer''' pin is connected to '''analog''' pin A0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:33&lt;br /&gt;
| '''fwdbuttonPin '''is the '''variable''' for '''push button''' connected to pin 13 of '''Arduino'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:40&lt;br /&gt;
| '''bckbuttonPin '''is the '''variable''' for '''push button''' connected to pin 12 of '''Arduino'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:47&lt;br /&gt;
| '''ICpin2''' and''' ICpin7 '''are the '''variables''' which indicate pin 2 and pin 7 of the '''IC'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|07:57&lt;br /&gt;
| They are connected to pin 11 and pin 10 of '''Arduino''' respectively. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:04&lt;br /&gt;
| First we make sure that the '''potentiometer, motor''' and '''push buttons''' are in '''LOW''' state. &lt;br /&gt;
&lt;br /&gt;
For that we have initialised it to 0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:15&lt;br /&gt;
| In the''' void setup function''', we will write this code. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:20&lt;br /&gt;
| '''pinMode function''' defines the pins as '''INPUT''' or '''OUTPUT'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:25&lt;br /&gt;
| '''fwdbuttonPin''' and '''bckbuttonPin''' are set to '''INPUT_PULLUP '''mode. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|08:32&lt;br /&gt;
| In this mode we are using '''Arduino’s''' internal '''pull-up resistors'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:38&lt;br /&gt;
| To know about the '''INPUT_PULLUP''' mode, refer to the manual. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:44&lt;br /&gt;
| Click on the '''Help menu''' in the '''Arduino IDE.''' &lt;br /&gt;
&lt;br /&gt;
Then click on '''Reference.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:50&lt;br /&gt;
| This opens an offline page in your browser. &lt;br /&gt;
&lt;br /&gt;
Scroll down. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|08:55&lt;br /&gt;
| Click on '''INPUT_PULLUP. ''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:00&lt;br /&gt;
| Switch back to '''Arduino IDE.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:03&lt;br /&gt;
| '''ICpin2 '''and''' ICpin7 '''are set to '''OUTPUT''' mode to drive the '''motor'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:10&lt;br /&gt;
| Next we will write the code in '''void loop function'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:14&lt;br /&gt;
| '''analogRead command''' will read the '''analog''' value from the '''potentiometer'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:20&lt;br /&gt;
| This value will be given to '''analog''' pin A0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:24&lt;br /&gt;
| Depending upon the '''potentiometer''' value, the speed of the '''motor''' will vary. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:30&lt;br /&gt;
| '''map command''' will convert the '''analog''' value to '''digital'''. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|09:35&lt;br /&gt;
| '''fwdbuttonState''' and '''bckbuttonState''' will fetch the '''signal''' if '''push button''' is pressed. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:43&lt;br /&gt;
| The '''IF command''' checks, if the '''push button''' connected to pin 12 or pin 13 is pressed. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:50&lt;br /&gt;
| This enables the '''motor''' to rotate in a clockwise or anti-clockwise direction. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:56&lt;br /&gt;
| Suppose we don’t press any of the two '''buttons'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:00&lt;br /&gt;
| Then the '''else command''' ensures the '''motor''' is in '''OFF''' condition. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:05&lt;br /&gt;
| This code is available in the '''Code file''' link of this tutorial &lt;br /&gt;
&lt;br /&gt;
You can download and use it. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:13&lt;br /&gt;
| Click on the '''compile''' button to verify the '''program'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:17&lt;br /&gt;
| Let us save the program as '''PWM_Motor''' and click on the '''Save''' button. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:25&lt;br /&gt;
| Now click on '''upload''' button to '''upload''' the current '''program''' on '''Arduino'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:31&lt;br /&gt;
| Now we will see the output of the above '''program'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:35&lt;br /&gt;
| I’ll press the '''push button''' connected to '''pin 13'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:39&lt;br /&gt;
| We can see the '''motor''' rotating in the clockwise direction. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:43&lt;br /&gt;
| Now I will release the '''push button'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:47&lt;br /&gt;
| The '''motor''' will stop rotating and it will be in '''OFF''' state. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:52&lt;br /&gt;
| Now again, I’ll press the '''push button''' connected to '''pin 12'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:57&lt;br /&gt;
| We can see the '''motor''' is rotating in anti-clockwise direction. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|11:02&lt;br /&gt;
| We can change the speed of '''motor''' by adjusting the '''potentiometer''' connected to A0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 11:14&lt;br /&gt;
| This brings us to the end of this tutorial. Let us summarize. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|11:20&lt;br /&gt;
| In this tutorial, we learnt about &lt;br /&gt;
&lt;br /&gt;
'''Pulse Width modulation''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|11:26&lt;br /&gt;
|  '''PWM Duty Cycle''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|11:29&lt;br /&gt;
|  '''PWM Frequency '''and  How to control speed and direction of '''DC motor.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|11:38&lt;br /&gt;
| As an '''assignment''': &lt;br /&gt;
&lt;br /&gt;
Connect a '''Buzzer''' instead of '''LED''' in the above circuit connection. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|11:45&lt;br /&gt;
|  Upload the same '''program''' and check the output. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|11:49&lt;br /&gt;
| You would hear a noise with different frequencies. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 11:53&lt;br /&gt;
| Here is the output of the assignment. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|12:01&lt;br /&gt;
| The video at the following link summarizes the '''Spoken Tutorial''' project. &lt;br /&gt;
&lt;br /&gt;
Please download and watch it. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|12:09&lt;br /&gt;
| The''' Spoken Tutorial Project''' Team conducts '''workshops''' and gives certificates. &lt;br /&gt;
&lt;br /&gt;
For more details, please write to us. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|12:19&lt;br /&gt;
| Please post your timed queries in this '''forum'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|12:23&lt;br /&gt;
| '''Spoken Tutorial''' project is funded by '''MHRD, Government of India'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 12:29&lt;br /&gt;
| This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay. &lt;br /&gt;
&lt;br /&gt;
And this is Saurabh signing off. &lt;br /&gt;
&lt;br /&gt;
Thanks for joining. &lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PoojaMoolya</name></author>	</entry>

	</feed>