Difference between revisions of "Electronic Greeter"
From Microduino Wiki
(→Hardware Buildup) |
(→Objective) |
||
(One intermediate revision by one other user not shown) | |||
Line 4: | Line 4: | ||
| | | | ||
==Objective== | ==Objective== | ||
− | This Electronic Greeter will play happy music when someone | + | This Electronic Greeter will play happy music when someone walks by. |
[[File: Electronic_greeting-music.jpg|600px|center]] | [[File: Electronic_greeting-music.jpg|600px|center]] | ||
Line 95: | Line 95: | ||
*Setup6:Stack all the modules without fixed order (Except that Audio, AudioShield and Amplifier should be stacked together.) | *Setup6:Stack all the modules without fixed order (Except that Audio, AudioShield and Amplifier should be stacked together.) | ||
[[file: Electronic_greeting _steup_ok.JPG|600px|center]] | [[file: Electronic_greeting _steup_ok.JPG|600px|center]] | ||
− | Attention! Audio must be powered through BM, which cannot be | + | (Attention! Audio must be powered through BM, which cannot be connected to computer and powered through Coreusb or it will fail to work.) |
==Result== | ==Result== |
Latest revision as of 09:18, 4 August 2017
Language: | English • 中文 |
---|
ContentsObjectiveThis Electronic Greeter will play happy music when someone walks by. SchematicMicroduino-PIR sensor will detect if there is someone moving. If there is, this device will get lighten and play music, which lasts for a while and then stop. Equipment
Program Download
Software Debugging
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
//#define AUDIO_PORT Serial1 //Core+
#define AUDIO_PORT mySerial //Core
#define humanHotSensor 4//PIR sensor D4
#define PIN 6//Colored light
if (humanHotState) {
colorWipe(strip.Color(125, 125, 125));//The colored light is on
if (!playing) {
Serial.println("play sound.....");
// audio_play();
audio_choose(1);//Play audio
playing = true;
}
}
else
{
playing = false;
//audio_pause();
Serial.println("stop sound.....");
colorWipe(strip.Color(0, 0, 0));
} Hardware Buildup
For connection method, please refer to the following picture. Mind connection order, which starts from LED interface IN to Out. It can control six LED lights at most.
[File:CoreUSB_Ble_steup2.jpg|600px|center]]
(Attention! Audio must be powered through BM, which cannot be connected to computer and powered through Coreusb or it will fail to work.) ResultWhen it detects someone moves, the colored led will turn on and play music. You can build a beautiful frame with LEGO. Video |