“Electronic Greeter”的版本间的差异
(Created page with "{{Language| Electronic Greeter}} {| style="width: 800px;" |- | ==Objective== This Electronic Greeter will play happy music when someone walking by. File: Electronic_greetin...") |
(→Hardware Buildup) |
||
第95行: | 第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 stacked with Coreusb and be powered through computer or it will fail to work. | ||
==Result== | ==Result== |
2015年9月22日 (二) 08:28的版本
Language | English |
---|
目录ObjectiveThis Electronic Greeter will play happy music when someone walking 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 stacked with Coreusb and be powered through computer 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 |