Arduino Advent Calendar Day 17 (Hall Effect Sensor) - NOT WORKING!
I have just completed the Arduino Advent Calendar Day 17 (Hall Effect Sensor) and there is no magnetic field nearby and the LED turns on. I copied the code from the Git Hub code hosting on the guide. Please help I have attached images and my code.
int led = 13;//LED pin
int sensor = 10; //sensor pin
int val; //numeric variable
pinMode(sensor, INPUT); //set sensor pin as input
val = digitalRead(sensor); //Read the sensor
if(val == HIGH) //when magnetic field is detected, turn led on
Is this a good question?