29
breaking the circuit. Therefore, as line switch components function by magnetic signals, they
can be used to count stuff, restrict positions and so on. At the same time, it is widely used in
a variety of communication devices.
In this experiment, since an LED has been attached to pin 13, just connect pin D0 of the reed
switch to D8 of the SunFounder Uno board. When the reed switch inducts magnetic field
signals, the LED will be on. Otherwise, it will be off.
Experimental Procedures
Step 1:
Build the circuit
Reed Switch Module SunFounder Uno
AO ---------------------------------------- A0
DO ----------------------------------------D8
- ----------------------------------------- GND
+ ------------------------------------------ 5V
Step 2:
Program (Please refer to the example code in
LEARN -> Get Tutorial
on our
website
)
Step 3:
Compile
Step 4:
Upload the sketch to SunFounder Uno
Now, put a magnet close to the reed switch, and you will see the LED attached to pin 13 on
the SunFounder Uno board light up.
SunFounder