<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.linksprite.com/index.php?action=history&amp;feed=atom&amp;title=Project_Linear_Potentiometer_Module</id>
	<title>Project Linear Potentiometer Module - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linksprite.com/index.php?action=history&amp;feed=atom&amp;title=Project_Linear_Potentiometer_Module"/>
	<link rel="alternate" type="text/html" href="https://wiki.linksprite.com/index.php?title=Project_Linear_Potentiometer_Module&amp;action=history"/>
	<updated>2026-04-27T15:12:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.linksprite.com/index.php?title=Project_Linear_Potentiometer_Module&amp;diff=474&amp;oldid=prev</id>
		<title>Jingfeng: Created page with &quot;&lt;syntaxhighlight lang=&quot;c&quot;&gt;  /*   Analog input, analog output, serial output   Reads an analog input pin, and T000150 Linear Potetiometer Analog Sensor connected to I0, maps th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.linksprite.com/index.php?title=Project_Linear_Potentiometer_Module&amp;diff=474&amp;oldid=prev"/>
		<updated>2012-11-24T05:04:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;  /*   Analog input, analog output, serial output   Reads an analog input pin, and T000150 Linear Potetiometer Analog Sensor connected to I0, maps th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
  Analog input, analog output, serial output&lt;br /&gt;
&lt;br /&gt;
 Reads an analog input pin, and T000150 Linear Potetiometer Analog Sensor connected to I0, maps the result to a range from 0 to 255&lt;br /&gt;
 and uses the result to set the pulsewidth modulation (PWM) on a T010111 LED Module connected on O0.&lt;br /&gt;
 Also prints the results to the serial monitor.&lt;br /&gt;
&lt;br /&gt;
 created 29 Dec. 2008&lt;br /&gt;
 Modified 4 Sep 2010&lt;br /&gt;
 by Tom Igoe&lt;br /&gt;
 modified 7 dec 2010&lt;br /&gt;
 by Davide Gomba &lt;br /&gt;
&lt;br /&gt;
 This example code is in the public domain.&lt;br /&gt;
&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #define O0 11&lt;br /&gt;
 #define O1 10&lt;br /&gt;
 #define O2 9&lt;br /&gt;
 #define O3 6&lt;br /&gt;
 #define O4 5&lt;br /&gt;
 #define O5 3&lt;br /&gt;
 #define I0 A0&lt;br /&gt;
 #define I1 A1&lt;br /&gt;
 #define I2 A2&lt;br /&gt;
 #define I3 A3&lt;br /&gt;
 #define I4 A4&lt;br /&gt;
 #define I5 A5&lt;br /&gt;
&lt;br /&gt;
// These constants won't change.  They're used to give names&lt;br /&gt;
// to the pins used:&lt;br /&gt;
const int analogInPin = I0;  // Analog input pin that the Linear Pot is attached to&lt;br /&gt;
const int analogOutPin= O0; // Analog output pin that the LED is attached to&lt;br /&gt;
&lt;br /&gt;
int sensorValue = 0;        // value read from the Linear pot&lt;br /&gt;
int outputValue = 0;        // value output to the PWM (analog out)&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  // initialize serial communications at 9600 bps:&lt;br /&gt;
  Serial.begin(9600); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
  // read the analog in value:&lt;br /&gt;
  sensorValue = analogRead(analogInPin);            &lt;br /&gt;
  // map it to the range of the analog out:&lt;br /&gt;
  outputValue = map(sensorValue, 0, 1023, 0, 255);  &lt;br /&gt;
  // change the analog out value:&lt;br /&gt;
  analogWrite(analogOutPin, outputValue);           &lt;br /&gt;
&lt;br /&gt;
  // print the results to the serial monitor:&lt;br /&gt;
  Serial.print(&amp;quot;sensor = &amp;quot; );                       &lt;br /&gt;
  Serial.print(sensorValue);      &lt;br /&gt;
  Serial.print(&amp;quot;\t output = &amp;quot;);      &lt;br /&gt;
  Serial.println(outputValue);   &lt;br /&gt;
&lt;br /&gt;
  // wait 10 milliseconds before the next loop&lt;br /&gt;
  // for the analog-to-digital converter to settle&lt;br /&gt;
  // after the last reading:&lt;br /&gt;
  delay(10);                     &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jingfeng</name></author>
		
	</entry>
</feed>