48
Lesson 17 Magic Cup
Introduction
There are two same Magic Cup modules in this kit, and each adds a separate LED based on
the mercury switch. You may learn the application of one module and then try to apply two
modules together to make one dim when at the same time the other brightens.
Components
-
1 * SunFounder Uno board
- 1 * USB data cable
- 2 * Magic cup module
- Several jumper wires
Experimental Principle
Connect pin S and pin L of one module to digital pin 7 and pin 5 of the SunFounder Uno
board; pin S and pin L of the other module to D4 and pin 6 of the Uno.
When you tilt one mercury switch, the LED attached will become dimmer gradually, while
the other LED will slowly brighten. The effect is just like the telepathy.
Experimental Procedures
Step 1:
Connect pin S and pin L of one module to D7 and pin 5 of the SunFounder Uno; pin S
and pin L of the other module to D4 and pin 6 of Uno.
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
SunFounder