Difference between revisions of "Birthday Lamp"
From Microduino Wiki
(Created page with "{{Language| Birthday Lantern}} {| style="width: 800px;" |- | ==Objective== To make a birthday lantern, press the button and play the music via a buzzer and you can see flashin...") |
|||
Line 1: | Line 1: | ||
− | {{Language| Birthday | + | {{Language| Birthday Lamp}} |
{| style="width: 800px;" | {| style="width: 800px;" | ||
|- | |- | ||
| | | | ||
==Objective== | ==Objective== | ||
− | To make a birthday | + | To make a birthday lamp, press the button and play the music via a buzzer and you can see flashing lamp. |
==Principle== | ==Principle== |
Revision as of 07:12, 31 July 2015
Language: | English • 中文 |
---|
ObjectiveTo make a birthday lamp, press the button and play the music via a buzzer and you can see flashing lamp. PrincipleDevice
Hardware Building
Software Debugging
#define PIXEL_PIN A0 //Colored light
int key_Pin = 2; //Key
int speakerPin = 6; //Buzzer
if (add == 1)
colorSet(strip.Color(i * 10, 0, 0));
else if (add == 2)
colorSet(strip.Color(0, i * 10, 0));
else if (add == 3)
colorSet(strip.Color(0, 0, i * 10));
else if (add == 4)
colorSet(strip.Color(i * 10, i * 10, 0));
if (!play_pause)
{
play_pause = false;
noTone(speakerPin);
return;
}
playNote(notes[i], beats[i]); // make sound ResultPress the crash switch, it will play music and the lights start flashing and turning brighter. Press the key again, it will turn off the music and the light. Video |