1
2
3 Author:
4
5
6
7
8 video series covering all Arduino sensors from the Arduino sensor kit.
9
10 of the sensors in this video series is the Hall sensor.
11
12
13 I will explain step by step how to use the Hall sensor
14
15
16
17 You're also welcome to take a look at the YouTube channel for more details about
18 hardware and software.
19
20
21
22
23
24
25
26int
27 hallSensorPin = 4;
28int hallSensorValue = 0;
29
30void setup() {
31
32 your setup code here, to run once:
33Serial.begin(9600);
34pinMode(hallSensorPin,INPUT);
35}
36
37void
38 loop() {
39
40
41hallSensorValue
42 = digitalRead(hallSensorPin);
43Serial.print("hallSensorValue: ");
44Serial.println(hallSensorValue);
45
46}
47