int hall_d=8;
int hall_a=A0;
void setup() {
// put your setup code here, to run once:
pinMode(hall_d,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(hall_d)==LOW)
{
Serial.print("Sensor");
Serial.println("hall closed");
}
else
{
Serial.print("Sensor");
Serial.println("hall moved");
}
Serial.println(analogRead(hall_a));
delay(1000);
}