August 27, 2015, at 01:37 PM by Simone Maiocchi -
Changed lines 1-6 from:
[[Tutorial.HomePage | Tutorials]] &gt; [[Tutorial.Examples | Examples]] &gt; Basics &gt; AnalogReadSerial
(:divend:)

(:*toc:)
to:
(:html:)

<div class="breadcrumb columns large-10 medium-10">
<p>
<a class="wikilink" href="/en/Tutorial/HomePage">Tutorials </a>
> <a class="wikilink" href="/en/Tutorial/BuiltInExamples"> Built-In Examples </a> > 01.Basics > AnalogReadSerial
</p>
</div>
</div>

(:htmlend:)

Deleted lines 26-27:

Connect the three wires from the potentiometer to your board. The first goes from one of the outer pins of the potentiometerto ground . The second goes from the other outer pin of the potentiometer to 5 volts. The third goes from the middle pin of the potentiometer to the analog pin A0.
Changed lines 28-30 from:
to:
Connect the three wires from the potentiometer to your board. The first goes from one of the outer pins of the potentiometerto ground . The second goes from the other outer pin of the potentiometer to 5 volts. The third goes from the middle pin of the potentiometer to the analog pin A0.

Changed lines 76-77 from:
(:include BasicsSeeAlsoIncludes :)
to:
* [[BareMinimum]] - The bare minimum of code needed to start an Arduino sketch.
* [[Blink | Blink]] - Turn an LED on and off.
* [[DigitalReadSerial]] - Read a switch, print the state out to the Arduino Serial Monitor.
* [[Fade]] - Demonstrates the use of analog output to fade an LED.

July 28, 2015, at 03:19 PM by Simone Maiocchi -
Changed lines 9-10 from:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your board, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino or Genuino and your computer running the Arduino IDE.
to:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your board, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino or Genuino and your computer running the Arduino Software (IDE).
Changed lines 28-30 from:
By turning the shaft of the potentiometer, you change the amount of resistance on either side of the wiper, which is connected to the center pin of the potentiometer. This changes the voltage at the center pin. When the resistance between the center and the side connected to 5 volts is close to zero (and the resistance on the other side is close to 10k ohm), the voltage at the center pin nears 5 volts. When the resistances are reversed, the voltage at the center pin nears 0 volts, or ground. This voltage is the '''analog voltage''' that you're reading as an input.

The Arduino and Genuino boards have a circuit inside called an '''analog-to-digital converter''' that reads this changing voltage and converts it to a number between 0 and 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and the input value is 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
to:
By turning the shaft of the potentiometer, you change the amount of resistance on either side of the wiper, which is connected to the center pin of the potentiometer. This changes the voltage at the center pin. When the resistance between the center and the side connected to 5 volts is close to zero (and the resistance on the other side is close to 10k ohm), the voltage at the center pin nears 5 volts. When the resistances are reversed, the voltage at the center pin nears 0 volts, or ground. This voltage is the ''analog voltage'' that you're reading as an input.

The Arduino and Genuino boards have a circuit inside called an ''analog-to-digital converter or ADC'' that reads this changing voltage and converts it to a number between 0 and 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and the input value is 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
Changed lines 49-50 from:
Finally, you need to print this information to your serial window. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:
to:
Finally, you need to print this information to your serial monitor window. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:
Changed lines 53-56 from:
Now, when you open your Serial Monitor in the Arduino IDE (by clicking the icon that looks like a lens, on the right, in the green top bar or using the keyboard shortcut Ctrl+Shift+M), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

to:
Now, when you open your Serial Monitor in the Arduino Software (IDE) (by clicking the icon that looks like a lens, on the right, in the green top bar or using the keyboard shortcut Ctrl+Shift+M), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.
Changed lines 69-70 from:

to:
\\
''Last revision 2015/07/28 by SM ''

July 07, 2015, at 05:34 PM by Simone Maiocchi -
July 07, 2015, at 05:30 PM by Simone Maiocchi -
Changed line 1 from:
to:
July 07, 2015, at 01:16 PM by Simone Maiocchi -
Changed lines 1-10 from:
''Examples > Basics''

This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your board, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino or Genuino and your computer running the Arduino IDE.

(:div class=BOM :)
!!!Hardware Required
* Arduino or Genuino Board
* 10k ohm Potentiometer
to:
[[Tutorial.HomePage | Tutorials]] &gt; [[Tutorial.Examples | Examples]] &gt; Basics &gt; AnalogReadSerial
(:*toc:)

This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your board, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino or Genuino and your computer running the Arduino IDE.

(:div class=BOM :)
!!!Hardware Required
* Arduino or Genuino Board
* 10k ohm Potentiometer
(:divend:)
July 04, 2015, at 07:57 PM by Simone Maiocchi -
Changed lines 45-48 from:
Finally, you need to print this information to your serial window as a decimal (@@DEC@@) value. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:

@@ Serial.println(sensorValue, DEC)@@
to:
Finally, you need to print this information to your serial window. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:

@@ Serial.println(sensorValue)@@
July 04, 2015, at 07:56 PM by Simone Maiocchi -
Changed lines 49-52 from:
Now, when you open your Serial Monitor in the Arduino IDE (by clicking the icon that looks like a lens, on the right, in the green top bar), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

to:
Now, when you open your Serial Monitor in the Arduino IDE (by clicking the icon that looks like a lens, on the right, in the green top bar or using the keyboard shortcut Ctrl+Shift+M), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

July 04, 2015, at 07:54 PM by Simone Maiocchi -
Changed lines 49-52 from:
Now, when you open your Serial Monitor in the Arduino IDE (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

to:
Now, when you open your Serial Monitor in the Arduino IDE (by clicking the icon that looks like a lens, on the right, in the green top bar), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

July 04, 2015, at 07:52 PM by Simone Maiocchi -
Changed line 55 from:
to:
July 04, 2015, at 06:31 PM by Simone Maiocchi -
Changed lines 5-6 from:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
to:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your board, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino or Genuino and your computer running the Arduino IDE.
Changed lines 9-10 from:
* Arduino Board
* 10-kilohm Potentiometer
to:
* Arduino or Genuino Board
* 10k ohm Potentiometer
Changed line 15 from:
Connect the three wires from the potentiometer to your Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 0 to the middle pin of the potentiometer.
to:
Connect the three wires from the potentiometer to your board. The first goes from one of the outer pins of the potentiometerto ground . The second goes from the other outer pin of the potentiometer to 5 volts. The third goes from the middle pin of the potentiometer to the analog pin A0.
Changed lines 24-26 from:
By turning the shaft of the potentiometer, you change the amount of resistance on either side of the wiper which is connected to the center pin of the potentiometer. This changes the voltage at the center pin. When the resistance between the center and the side connected to 5 volts is close to zero (and the resistance on the other side is close to 10 kilohms), the voltage at the center pin nears 5 volts. When the resistances are reversed, the voltage at the center pin nears 0 volts, or ground. This voltage is the '''analog voltage''' that you're reading as an input.

The Arduino has a circuit inside called an '''analog-to-digital converter''' that reads this changing voltage and converts it to a number between 0 and 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and the input value is 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
to:
By turning the shaft of the potentiometer, you change the amount of resistance on either side of the wiper, which is connected to the center pin of the potentiometer. This changes the voltage at the center pin. When the resistance between the center and the side connected to 5 volts is close to zero (and the resistance on the other side is close to 10k ohm), the voltage at the center pin nears 5 volts. When the resistances are reversed, the voltage at the center pin nears 0 volts, or ground. This voltage is the '''analog voltage''' that you're reading as an input.

The Arduino and Genuino boards have a circuit inside called an '''analog-to-digital converter''' that reads this changing voltage and converts it to a number between 0 and 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and the input value is 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
Changed lines 37-38 from:
In the program below, the only thing that you do will in the setup function is to begin serial communications, at 9600 bits of data per second, between your Arduino and your computer with the command:
to:
In the sketch below, the only thing that you do in the setup function is to begin serial communications, at 9600 bits of data per second, between your board and your computer with the command:
Changed lines 49-52 from:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

to:
Now, when you open your Serial Monitor in the Arduino IDE (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

April 30, 2013, at 05:22 PM by Federico -
Changed line 15 from:
Connect the three wires from the potentiometer to your Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 2 to the middle pin of the potentiometer.
to:
Connect the three wires from the potentiometer to your Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 0 to the middle pin of the potentiometer.
May 02, 2012, at 03:34 AM by Scott Fitzgerald -
Changed line 55 from:
to:
April 16, 2012, at 07:19 PM by Scott Fitzgerald -
Changed lines 41-42 from:
Next, in the main loop of your code, you need to establish a variable to store the resistance value (which will be between 0 and 1023, perfect for an [[ http://dev.arduino.cc/wiki/uno/Reference/Int | @@ int @@datatype ]]) coming in from your potentiometer:
to:
Next, in the main loop of your code, you need to establish a variable to store the resistance value (which will be between 0 and 1023, perfect for an [[ /Reference/Int | @@ int @@datatype ]]) coming in from your potentiometer:
November 16, 2011, at 12:43 AM by Scott Fitzgerald -
November 16, 2011, at 12:21 AM by Scott Fitzgerald -
Changed line 55 from:
to:
September 30, 2011, at 02:56 AM by Scott Fitzgerald -
Changed line 55 from:
to:
September 23, 2010, at 09:39 PM by Christian Cerrito -
[-click the image to enlarge-]
September 23, 2010, at 09:38 PM by Christian Cerrito -
Changed lines 29-30 from:
to:
[-click the image to enlarge-]
September 17, 2010, at 05:16 PM by Tom Igoe -
Changed lines 62-69 from:
* [[BareMinimum]] - bare minimum code needed to start a sketch
* [[BlinkBasic | Blink]] - turn an LED on and off.
* [[DigitalReadSerial]] - read a switch, print the state out to the Serial Monitor
* [[Fade]] - fade an LED with analog output
* [[Analog Input]] - use a potentiometer to control an LED's brightness

to:
(:include BasicsSeeAlsoIncludes :)

September 07, 2010, at 09:06 PM by Tom Igoe -
Changed lines 5-6 from:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
to:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a potentiometer (or ''pot'' for short) as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
Changed line 10 from:
* Potentiometer
to:
* 10-kilohm Potentiometer
Changed lines 22-24 from:
By turning the shaft of the potentiometer, you change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and a 0 value is read. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and a 1023 value is reported. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
to:
By turning the shaft of the potentiometer, you change the amount of resistance on either side of the wiper which is connected to the center pin of the potentiometer. This changes the voltage at the center pin. When the resistance between the center and the side connected to 5 volts is close to zero (and the resistance on the other side is close to 10 kilohms), the voltage at the center pin nears 5 volts. When the resistances are reversed, the voltage at the center pin nears 0 volts, or ground. This voltage is the '''analog voltage''' that you're reading as an input.

The Arduino has a circuit inside called an '''analog-to-digital converter''' that reads this changing voltage and converts it to a number between 0 and 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and the input value is 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
Changed lines 40-43 from:
@@ int sensorValue = analogRead(0);@@

Finally, you need to print this information to our serial window as a decimal (@@DEC@@) value. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:
to:
@@ int sensorValue = analogRead(A0);@@

Finally, you need to print this information to your serial window as a decimal (@@DEC@@) value. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:
September 07, 2010, at 08:58 PM by Tom Igoe -
Changed lines 5-6 from:
A potentiometer is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
to:
This example shows you how to read analog input from the physical world using a potentiometer. A '''potentiometer''' is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
August 29, 2010, at 07:03 PM by Christian Cerrito -
Changed line 22 from:
By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
to:
By turning the shaft of the potentiometer, you change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and a 0 value is read. When the shaft is turned all the way in the opposite direction, there are 5 volts going to the pin and a 1023 value is reported. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
Changed lines 40-41 from:
Finally, we need to print this information to our serial window as a decimal (@@DEC@@) value. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:
to:
Finally, you need to print this information to our serial window as a decimal (@@DEC@@) value. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:
August 24, 2010, at 07:52 AM by Christian Cerrito -
Changed lines 56-59 from:
* [[(Reference/)Int]]
* [[(Reference/)Serial]]
to:
* [[(Reference/)int]]
* [[(Reference/)serial]]
August 24, 2010, at 07:52 AM by Christian Cerrito -
Changed lines 61-67 from:
* [[BlinkBasic | Blink]]: turn an LED on and off.
* [[DigitalReadSerial]] - Read a switch, print the state out to the Serial Monitor
* [[Fade]] - Fading an LED with analog output
* [[Analog Input]] - Use a potentiometer to control an LED's brightness

to:
* [[BlinkBasic | Blink]] - turn an LED on and off.
* [[DigitalReadSerial]] - read a switch, print the state out to the Serial Monitor
* [[Fade]] - fade an LED with analog output
* [[Analog Input]] - use a potentiometer to control an LED's brightness

August 24, 2010, at 07:39 AM by Christian Cerrito -
Deleted line 51:
August 24, 2010, at 07:26 AM by Christian Cerrito -
Changed lines 65-68 from:
* [[Analog Input]] - Use a potentiometer to control an LED
=======

to:
* [[Analog Input]] - Use a potentiometer to control an LED's brightness

August 24, 2010, at 07:26 AM by Christian Cerrito -
Changed lines 53-56 from:

to:
Changed line 63 from:
* [[AnalogReadSerial]] - Read a potentiometer, print the state out to the Serial Monitor
to:
* [[DigitalReadSerial]] - Read a switch, print the state out to the Serial Monitor
Changed lines 65-68 from:
* [[Analog Input]] - Use a potentiometer to control an LED
to:
* [[Analog Input]] - Use a potentiometer to control an LED
=======

August 24, 2010, at 07:23 AM by Christian Cerrito -
Changed lines 56-57 from:
* [[Reference/CommandName | Reference page for this command]]
* [[Other example in this category]]
to:

* [[(Reference/)setup]]()
* [[(Reference/)loop]]()
* [[(Reference/)Int]]
* [[(Reference/)Serial]]

* [[BareMinimum]] - bare minimum code needed to start a sketch
* [[BlinkBasic | Blink]]: turn an LED on and off.
* [[AnalogReadSerial]] - Read a potentiometer, print the state out to the Serial Monitor
* [[Fade]] - Fading an LED with analog output
* [[Analog Input]] - Use a potentiometer to control an LED
August 21, 2010, at 06:42 AM by Christian Cerrito -
Changed lines 44-47 from:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond nearly instantly.

to:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond almost instantly.

August 21, 2010, at 06:41 AM by Christian Cerrito -
Changed lines 44-47 from:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will change almost instantly.

to:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will respond nearly instantly.

August 21, 2010, at 06:40 AM by Christian Cerrito -
Changed lines 36-37 from:
Next, in the main loop of your code, you need to establish a variable to store the resistance value (which will be between 0 and 1023) coming in from your potentiometer:
to:
Next, in the main loop of your code, you need to establish a variable to store the resistance value (which will be between 0 and 1023, perfect for an [[ http://dev.arduino.cc/wiki/uno/Reference/Int | @@ int @@datatype ]]) coming in from your potentiometer:
August 21, 2010, at 06:24 AM by Christian Cerrito -
Changed lines 44-47 from:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, depending on the position of the pot. As you turn your potentiometer, this numbers will change almost instantly.

to:
Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, correlating to the position of the pot. As you turn your potentiometer, these numbers will change almost instantly.

August 21, 2010, at 06:23 AM by Christian Cerrito -
Changed lines 32-33 from:
In the program below, the very first thing that you do will in the setup function is to begin serial communications, at 9600 bits of data per second, between your Arduino and your computer with the line:
to:
In the program below, the only thing that you do will in the setup function is to begin serial communications, at 9600 bits of data per second, between your Arduino and your computer with the command:
Changed lines 36-41 from:
Next, initialize analog Input pin 0, the pin that will read the output from your potentiometer, as an input:

@@pinMode(0,INPUT);@@

to:
Next, in the main loop of your code, you need to establish a variable to store the resistance value (which will be between 0 and 1023) coming in from your potentiometer:

@@ int sensorValue = analogRead(0);@@

Finally, we need to print this information to our serial window as a decimal (@@DEC@@) value. You can do this with the command [[(Reference.)Serial.println]]() in your last line of code:

@@ Serial.println(sensorValue, DEC)@@

Now, when you open your Serial Monitor in the Arduino development environment (by clicking the button directly to the right of the "Upload" button in the header of the program), you should see a steady stream of numbers ranging from 0-1023, depending on the position of the pot. As you turn your potentiometer, this numbers will change almost instantly.

August 21, 2010, at 06:07 AM by Christian Cerrito -
Changed lines 38-41 from:
to:
@@pinMode(0,INPUT);@@

August 21, 2010, at 05:58 AM by Christian Cerrito -

In the program below, the very first thing that you do will in the setup function is to begin serial communications, at 9600 bits of data per second, between your Arduino and your computer with the line:

@@Serial.begin(9600);@@

Next, initialize analog Input pin 0, the pin that will read the output from your potentiometer, as an input:

August 21, 2010, at 05:43 AM by Christian Cerrito -
Changed line 30 from:
Describe what's going on here
to:
!!!Code
August 21, 2010, at 05:42 AM by Christian Cerrito -
Changed line 22 from:
By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, [[analogRead]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
to:
By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, [[Reference/analogRead | analogRead ]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
August 21, 2010, at 05:39 AM by Christian Cerrito -
Changed line 22 from:
By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, analogRead() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
to:
By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, [[analogRead]]() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
August 21, 2010, at 05:37 AM by Christian Cerrito -
Changed lines 5-6 from:
A potentiometer is a simple mechanical device that provides a varying amount of resistance when turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
to:
A potentiometer is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.
August 21, 2010, at 05:37 AM by Christian Cerrito -
Deleted lines 6-9:

By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, analogRead() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, analogRead() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
August 21, 2010, at 05:36 AM by Christian Cerrito -
Changed lines 5-8 from:
A potentiometer is a simple mechanical device that provides a variable resistance. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.

to:
A potentiometer is a simple mechanical device that provides a varying amount of resistance when turned. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.

August 21, 2010, at 05:35 AM by Christian Cerrito -
Changed lines 5-8 from:
A potentiometer is a simple knob that provides a variable resistance, which we can read into the Arduino board as an analog value. In this example you will monitor the state of your potentiometer by establishing .

to:
A potentiometer is a simple mechanical device that provides a variable resistance. By passing voltage through a potentiometer and into an analog input on your Arduino, it is possible to measure the amount of resistance produced by a "pot" as an analog value. In this example you will monitor the state of your potentiometer after establishing serial communication between your Arduino and your computer.

August 21, 2010, at 03:57 AM by Christian Cerrito -
Changed lines 5-6 from:
Description
to:
A potentiometer is a simple knob that provides a variable resistance, which we can read into the Arduino board as an analog value. In this example you will monitor the state of your potentiometer by establishing .

By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, analogRead() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.

Connect the three wires from the potentiometer to your Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 2 to the middle pin of the potentiometer.
August 21, 2010, at 03:39 AM by Christian Cerrito -
* Potentiometer
August 21, 2010, at 03:38 AM by Christian Cerrito -
Changed line 23 from:
%height=300px%[[ Attach:AnalogReadSerial_sch.png | Attach:ExampleCircuit_sch.png]]
to:
August 21, 2010, at 03:37 AM by Christian Cerrito -
Changed lines 15-16 from:
to:
August 21, 2010, at 03:35 AM by Christian Cerrito -
Changed lines 15-16 from:
%height=300px%[[Attach:ExampleCircuit_bb.png | Attach:ExampleCircuit_bb.png]]
to:
Changed line 23 from:
%height=300px%[[ Attach:ExampleCircuit_sch.png | Attach:ExampleCircuit_sch.png]]
to:
%height=300px%[[ Attach:AnalogReadSerial_sch.png | Attach:ExampleCircuit_sch.png]]
August 21, 2010, at 03:16 AM by Christian Cerrito -
Changed lines 3-4 from:
!!!Example Name
to:
August 13, 2010, at 10:20 PM by Tom Igoe -
August 13, 2010, at 10:19 PM by Tom Igoe -
Changed line 29 from:
to:
August 13, 2010, at 10:19 PM by Tom Igoe -
Changed line 29 from:
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/WebClient/WebClient.pde lang=arduino tabwidth=4:)
to:
August 13, 2010, at 10:18 PM by Tom Igoe -
''Examples > Basics''

!!!Example Name

Description

(:div class=BOM :)
!!!Hardware Required
* Arduino Board
(:divend:)

!!!Circuit
(:div class=circuit :)

%height=300px%[[Attach:ExampleCircuit_bb.png | Attach:ExampleCircuit_bb.png]]

[-image developed using [[http://www.fritzing.org |Fritzing]]. For more circuit examples, see the [[http://fritzing.org/projects/|Fritzing project page]] -]

(:divend:)

!!!Schematic
(:div class=circuit :)
%height=300px%[[ Attach:ExampleCircuit_sch.png | Attach:ExampleCircuit_sch.png]]
(:divend:)

Describe what's going on here

(:div class=code :)
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/WebClient/WebClient.pde lang=arduino tabwidth=4:)
(:divend:)