keyestudio
www.keyestudio.cc
82
{
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
to regulate light brightness. Through
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
Содержание ARDUINO maker learning kit
Страница 1: ...keyestudio www keyestudio cc ARDUINO maker learning kit...
Страница 23: ...keyestudio www keyestudio cc 21 Connection for 2560 R3...
Страница 30: ...keyestudio www keyestudio cc 28 Connection for 2560 R3...
Страница 39: ...keyestudio www keyestudio cc 37 Connection for 2560 R3...
Страница 43: ...keyestudio www keyestudio cc 41 Connection for 2560 R3...
Страница 46: ...keyestudio www keyestudio cc 44 Connection for 2560 R3...
Страница 50: ...keyestudio www keyestudio cc 48 Connection for 2560 R3...
Страница 53: ...keyestudio www keyestudio cc 51 Connection circuit as below Connection for R3 Connection for 2560 R3...
Страница 58: ...keyestudio www keyestudio cc 56 Connection for 2560 R3...
Страница 62: ...keyestudio www keyestudio cc 60 Connection for 2560 R3...
Страница 65: ...keyestudio www keyestudio cc 63 Circuit connection Connection for R3...
Страница 66: ...keyestudio www keyestudio cc 64 Connection for 2560 R3...
Страница 69: ...keyestudio www keyestudio cc 67 Pic 2 Project 15 LM35 temperature sensor...
Страница 71: ...keyestudio www keyestudio cc 69 Connection for 2560 R3 Sample program...
Страница 74: ...keyestudio www keyestudio cc 72 Schematic diagram...
Страница 77: ...keyestudio www keyestudio cc 75 Circuit connection Connection for R3...
Страница 78: ...keyestudio www keyestudio cc 76 Connection for 2560 R3...
Страница 80: ...keyestudio www keyestudio cc 78 Result...
Страница 82: ...keyestudio www keyestudio cc 80 Connection for 2560 R3...
Страница 85: ...keyestudio www keyestudio cc 83 Schematic diagram Circuit connection Connection for R3...
Страница 91: ...keyestudio www keyestudio cc 89 Circuit connection Connection for R3...
Страница 92: ...keyestudio www keyestudio cc 90 Connection for 2560 R3...
Страница 95: ...keyestudio www keyestudio cc 93...
Страница 96: ...keyestudio www keyestudio cc 94...
Страница 104: ...keyestudio www keyestudio cc 102 Connection for 2560 R3...
Страница 111: ...keyestudio www keyestudio cc 109 Connection for R3 Connection for 2560 R3...
Страница 120: ...keyestudio www keyestudio cc 118 Connection for 2560 R3...
Страница 124: ...keyestudio www keyestudio cc 122 Connection for R3 Connection for 2560 R3...
Страница 135: ...keyestudio www keyestudio cc 133 Connection for R3 Connection for 2560 R3...
Страница 139: ...keyestudio www keyestudio cc 137 Circuit connection Connection for uno R3...
Страница 140: ...keyestudio www keyestudio cc 138 Connection for 2560 R3...
Страница 144: ...keyestudio www keyestudio cc 142 Circuit connection Connection for R3...
Страница 145: ...keyestudio www keyestudio cc 143 Connection for 2560 R3...
Страница 148: ...keyestudio www keyestudio cc 146 Connection for 2560 R3 Sample program...
Страница 155: ...keyestudio www keyestudio cc 153 Circuit connection Connection for R3...
Страница 156: ...keyestudio www keyestudio cc 154 Connection for 2560 R3...
Страница 160: ...keyestudio www keyestudio cc 158 Connection for 2560 R3...