SunFounder 3in1 Kit
1.read_button_value.
• Or copy this code into Arduino IDE.
After the code is uploaded successfully, click the magnifying glass icon in the upper right corner of the Arduino IDE
(Serial Monitor).
When you press the button, the Serial Monitor will print “1”.
4.3.3 3.2 Feel the Magnetism
The most common type of reed switch contains a pair of magnetizable, flexible, metal reeds whose end portions are
separated by a small gap when the switch is open.
A magnetic field from an electromagnet or a permanent magnet will cause the reeds to attract each other, thus complet-
ing an electrical circuit. The spring force of the reeds causes them to separate, and open the circuit, when the magnetic
field ceases.
A common example of a reed switch application is to detect the opening of a door or windows, for a security alarm.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
Name ITEMS IN THIS KIT LINK
3 in 1 Starter Kit 380+
You can also buy them separately from the links below.
COMPONENT INTRODUCTION PURCHASE LINK
Arduino Uno R4 Minima -
Breadboard
Jumper Wires
Resistor
Reed Switch -
Schematic
110 Chapter 4. Basic Projects