> For the complete documentation index, see [llms.txt](https://longer-vision-robot.gitbook.io/arduino-full-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://longer-vision-robot.gitbook.io/arduino-full-stack/06_magnetic_sensors/031_analoghall.md).

# 6.5 Analog Hall

## Hardware Wiring

![Analog Hall](/files/-LCFEM7Em42PpKSjth1m)

## Sketch

The code can be found at [Examples\_Arduino - sensor-kit-for-arduino - \_031\_Analog\_Hall - \_031\_Analog\_Hall.ino](https://github.com/LongerVisionRobot/Examples_Arduino/blob/master/sensor-kit-for-arduino/_031_Analog_Hall/_031_Analog_Hall.ino).

```
int sensorPin = A5;   // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  pinMode(ledPin, OUTPUT); 
  Serial.begin(9600); 
}

void loop() { 
  sensorValue = analogRead(sensorPin);    
  digitalWrite(ledPin, HIGH);  
  delay(sensorValue);          
  digitalWrite(ledPin, LOW);   
  delay(sensorValue);
  Serial.println(sensorValue, DEC);  
}
```
