Project 19: Magical Light Cup - Keyestudio ARDUINO maker learning kit Manual

Table of Contents

Advertisement

{
i=analogRead(5);// read the voltage value of analog pin 5
if(i>512)// if larger that 512(2.5V)
{
digitalWrite(8,LOW);// turn on LED
}
else// otherwise
{
digitalWrite(8,HIGH);// turn off LED
}
}
}
//////////////////////////////////////////////////////////
Result
Hold the breadboard with your hand. Tilt it to a certain extent, the LED will be on.
If there is no tilt, the LED will be off.
The principle of this experiment can be applied to relay control.
Experiment completed.
Thank you!
*******************************************************************************

Project 19: Magical Light Cup

Introduction
Magical light cup module is a product developed by KEYES that can interact with ARDUINO.
The principle is to use PWM to regulate light brightness of the two modules.
Mercury switch provides digital signal, triggering PWM
the designed program,
We can see effect like two cups pouring light to each other.
Hardware required
Ball tilt switch *2
Led *2
220Ω resistor *2
10KΩ resistor *2
Breadboard *1
Breadboard jumper wires *several
keyestudio
www.keyestudio.cc
to regulate light brightness. Through
82

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ARDUINO maker learning kit and is the answer not in the manual?

Related Products for Keyestudio ARDUINO maker learning kit

Table of Contents