SunFounder 3in1 Kit
Note:
• You can open the file 4.5_thermometer.ino under the path of euler-kit/arduino/4.5_thermometer.
• Or copy this code into Arduino IDE.
Don’t forget to select the Raspberry Pi Pico board and the correct port before clicking the Upload button.
After the code is successfully uploaded, the Serial Monitor will print out the Celsius and Fahrenheit temperatures.
4.5 5. More Syntax
In this chapter, you will find some examples that illustrate the basic logic of how most programs interact with reality.
This will help you become familiar with Arduino programming. When you have a creative idea in mind, programming
will no longer be challenging for you.
4.5.1 5.1 If else
Usually we use conditional judgment to complete the most basic reality interaction projects. Here, we build a door
detection system with reed switch and LED to show this logic.
Fix the magnet on one side of the door and the reed switch (with circuit) on the other side of the door. When the door
is closed, the magnet is close to the reed switch, which will turn it on.
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
LED
Reed Switch -
Schematic
132 Chapter 4. Basic Projects