<?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_Hall_Sensor</id>
	<title>Project Hall Sensor - 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_Hall_Sensor"/>
	<link rel="alternate" type="text/html" href="https://wiki.linksprite.com/index.php?title=Project_Hall_Sensor&amp;action=history"/>
	<updated>2026-09-10T15:39:38Z</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_Hall_Sensor&amp;diff=449&amp;oldid=prev</id>
		<title>Jingfeng: Created page with &quot;&lt;syntaxhighlight lang=&quot;c&quot;&gt;  /*   Analog input, digital output, serial output   Reads an analog input pin; T000070 Hall Sensor connected to I0 reacts   to the magnet direction ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.linksprite.com/index.php?title=Project_Hall_Sensor&amp;diff=449&amp;oldid=prev"/>
		<updated>2012-11-24T00:59:31Z</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, digital output, serial output   Reads an analog input pin; T000070 Hall Sensor connected to I0 reacts   to the magnet direction ...&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, digital output, serial output&lt;br /&gt;
&lt;br /&gt;
 Reads an analog input pin; T000070 Hall Sensor connected to I0 reacts &lt;br /&gt;
 to the magnet direction and uses the result to light up a T010111 LED Module connected on O0.&lt;br /&gt;
 Also prints the value of the Hall Sensor to the serial monitor.&lt;br /&gt;
&lt;br /&gt;
 created on 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 Hall Sensor is attached to&lt;br /&gt;
const int digitalOutPin= O0; // Digital 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;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  // initialize serial communications at 9600 bps:&lt;br /&gt;
  Serial.begin(9600); &lt;br /&gt;
  pinMode(digitalOutPin, OUTPUT);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
  // read the analog in value:&lt;br /&gt;
&lt;br /&gt;
  sensorValue = analogRead(analogInPin);  &lt;br /&gt;
&lt;br /&gt;
  if (sensorValue &amp;lt; 505) { // notice that the normal value of the sensor is 510&lt;br /&gt;
   digitalWrite(digitalOutPin, HIGH);&lt;br /&gt;
   } else {&lt;br /&gt;
   digitalWrite(digitalOutPin, LOW);&lt;br /&gt;
   }&lt;br /&gt;
  // print the results to the serial monitor:&lt;br /&gt;
  Serial.print(&amp;quot;Hall Sensor Value = &amp;quot; );                       &lt;br /&gt;
  Serial.println(sensorValue);      &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;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jingfeng</name></author>
		
	</entry>
</feed>