Applause Enthusiasm Detection
Language | English |
---|
目录[隐藏]ObjectiveHere we’ll detect applause. The louder it gets, the brighter the light turns. When the brightness gets to the most, the buzzer will give an alarm. PrincipleEquipment
文件:Applause heat.jpg 600px Hardware Buildup
文件:Applause heat bm.JPG 800px Software Debugging
Applause_heat Code description
#define PIN 4
Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);
#define mic_pin A0
#define buzzer_pin 6
#define voice 400
if (voice_data > voice)
{
num++;
if (num > 255)
{
num = 255;
buzzer();
}
colorWipe(strip.Color(num, 0, 0));
//delay(10);
Serial.println(num);
time = millis();
}
ResultThe louder the applause gets, the brighter the lamp becomes. When it reaches to the brightest, the buzzer will give an alarm. When the sound gets below the pre-set value after that, it will take three seconds and then turn off the light and the buzzer. (You can achieve a beautiful frame with LEGO.) Video |