SunFounder 3in1 Kit
Return 1 if the servo is currently attached.
4.5.6 5.6 Map
If you observe carefully, you will notice that many values have different ranges in programming. For example, the range
of values for analog inputs is (0~1023). The value range for the analog output is (0~255). The output angle of the servo
is (0~180).
This means that if we want to use the potentiometer to control the brightness of the LED or the angle of the servo, we
need to go through a mapping operation.
Now let’s see how to achieve it.
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
Servo
Potentiometer
Schematic
148 Chapter 4. Basic Projects