精品国产人成在线_亚洲高清无码在线观看_国产在线视频国产永久2021_国产AV综合第一页一个的一区免费影院黑人_最近中文字幕MV高清在线视频

電子發(fā)燒友App

硬聲App

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>如何制作聲控LED面罩

如何制作聲控LED面罩

2023-02-08 | zip | 0.13 MB | 次下載 | 免費

資料介紹

描述

聲控 LED 面罩連接說明

防范措施:

制作聲控?zé)裘嬲謺r,電路焊接時請小心,以免被焊機燙傷皮膚!請正確連接電路并選擇好的充電寶。電路短路和電流輸入不良可能引起事故!聲光口罩是要貼在臉上的,所以口罩面料的選擇很重要,請選擇防火面料!最后請小孩子在大人陪同下制作。

所需工具:

焊接

烙鐵

織物膠水或針線包

護目鏡

膠帶

可選有用的東西

熱縮管(電工膠帶可以在緊要關(guān)頭使用,但熱縮管很好)

數(shù)字萬用表(用于確保您的連接正確且電子設(shè)備正常工作)

焊墊

阿杜諾納米

零件

LED 矩陣 8x8 WS2812B

麥克風(fēng)max4466

阿杜諾納米

330Ω電阻

24號線

熱收縮

5V移動電源

KCD1開關(guān)

物理電路圖

pYYBAGPi9cKAX-_AAAEqlM0xoTo894.jpg
?

電路連接

LED 矩陣 8x8 WS2812B DIN 引腳------------330Ω 電阻

330Ω電阻------------Arduino Nano D6 Pin

max4466麥克風(fēng)VCCpin--------------Arduino Nano 5V Pin

max4466麥克風(fēng)GNDpin------------Arduino Nano GND Pin

max4466 麥克風(fēng)輸出引腳--------------Arduino Nano A7 引腳

LED 矩陣 8x8 WS2812B 5V 引腳------------ Arduino Nano VIN 引腳

LED 矩陣 8x8 WS2812B GND pin------------ Arduino Nano GND pin

KCD1開關(guān)------------ Arduino Nano D12引腳

Arduino Nano GNDpin------------ KCD1開關(guān)

生產(chǎn)

1、安裝庫文件:打開Arduino開發(fā)軟件中的“工具”-“庫管理器”,然后搜索Adafruit_NeoPixel、Adafruit_NeoMatrix、Adafruit_GFX_Library,然后安裝這三個庫

?
?
?
pYYBAGPi9cmAQEqtAACKAIoKfCo077.jpg
?
1 / 3
?

?

poYBAGPi9d6AaO9rAADsD50NL_0410.jpg
?

?

pYYBAGPi9eiAcak3AADnMAqIiMc181.jpg
?

2.選擇開發(fā)板為Arduino Nano,這個是選對了。

poYBAGPi9eyACIYJAADPVGUteTM704.jpg
?

3.選擇處理器為ATmega328P(Old Bootloader),這個是選對了。

pYYBAGPi9e-AKKU-AACiuYH7CGI972.jpg
?

4、然后選擇端口,這個端口要和你在設(shè)備管理器里看到的一樣,這樣你就可以把代碼燒進開發(fā)板了。

pYYBAGPi9fKAUMZoAACH7IeHIIs039.jpg
?

?

?

#include #include #include #define lengthof(A) ((sizeof((A))/sizeof((A)[0])))
#define button 12
int oldstate=HIGH;
const PROGMEM uint8_t mouth_0[8][8] = {
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,6,6,6,6,0,0}, 
   {0,6,6,6,6,6,6,0},
   {6,6,0,0,0,0,6,6},
   {6,0,0,0,0,0,0,6},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0}
};
const PROGMEM uint8_t mouth_4[8][8] = {
   {0,0,7,7,7,7,0,0},
   {0,7,0,0,0,0,7,0},
   {7,0,0,0,0,0,0,7},
   {7,0,0,0,0,0,0,7},
   {7,0,0,0,0,0,0,7},
   {7,0,0,0,0,0,0,7},
   {0,7,0,0,0,0,7,0},
   {0,0,7,7,7,7,0,0}
};
const PROGMEM uint8_t mouth_3[8][8] = {
   {0,0,0,0,0,0,0,0},
   {0,0,7,7,7,7,0,0},
   {0,7,0,0,0,0,7,0},
   {7,0,0,0,0,0,0,7},
   {7,0,0,0,0,0,0,7},
   {0,7,0,0,0,0,7,0},
   {0,0,7,7,7,7,0,0},
   {0,0,0,0,0,0,0,0}
};
const PROGMEM uint8_t mouth_2[8][8] = {
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,7,7,7,7,7,7,0},
   {7,0,0,0,0,0,0,7},
   {7,0,0,0,0,0,0,7},
   {0,7,7,7,7,7,7,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0}
};
const PROGMEM uint8_t mouth_1[8][8] = {
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,7,7,0,0,0},
   {7,7,7,0,0,7,7,7},
   {7,7,7,0,0,7,7,7},
   {0,0,0,7,7,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0}
};
const PROGMEM uint8_t mouth_smile[8][8] = {
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {2,0,0,0,0,0,0,2},
   {2,2,0,0,0,0,2,2},
   {0,2,2,2,2,2,2,0},
   {0,0,2,2,2,2,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0}
};
const PROGMEM uint8_t off_set[8][8] = {
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0}
};
uint16_t palette[8] = {};
Adafruit_NeoMatrix matrix1 = Adafruit_NeoMatrix(8, 8, 6,
 NEO_MATRIX_BOTTOM     + NEO_MATRIX_RIGHT +
 NEO_MATRIX_ROWS    + NEO_MATRIX_ZIGZAG,
 NEO_GRB            + NEO_KHZ800);
Adafruit_NeoMatrix matrix2 = Adafruit_NeoMatrix(8, 8, 7,
 NEO_MATRIX_BOTTOM     + NEO_MATRIX_RIGHT +
 NEO_MATRIX_ROWS    + NEO_MATRIX_ZIGZAG,
 NEO_GRB            + NEO_KHZ800);
Adafruit_NeoMatrix matrix3 = Adafruit_NeoMatrix(8, 8, 2,
 NEO_MATRIX_BOTTOM     + NEO_MATRIX_RIGHT +
 NEO_MATRIX_ROWS    + NEO_MATRIX_ZIGZAG,
 NEO_GRB            + NEO_KHZ800); 
Adafruit_NeoMatrix matrix4 = Adafruit_NeoMatrix(8, 8, 0,
 NEO_MATRIX_BOTTOM     + NEO_MATRIX_RIGHT +
 NEO_MATRIX_ROWS    + NEO_MATRIX_ZIGZAG,
 NEO_GRB            + NEO_KHZ800); 
void drawImage(short image_addr){
   for(int x = 0; x<8; x++){
       for(int y = 0; y<8; y++){
           uint8_t index = pgm_read_byte(image_addr+x+y*8);
           matrix1.drawPixel(x, y, palette[index]); 
           matrix2.drawPixel(x, y, palette[index]); 
           matrix3.drawPixel(x, y, palette[index]);  
           matrix4.drawPixel(x, y, palette[index]);
       }
   }
   matrix1.show();
   matrix2.show();
   matrix3.show();
   matrix4.show();
}
int pop_detection = 0;
bool smiling = false;
unsigned long smiletimer = 0;
unsigned long last_face = 0;
float vol = 0;
const uint16_t samples = 128;
void setup() {
   Serial.begin(9600);
   matrix1.begin();
   matrix2.begin();
   matrix3.begin();
   matrix4.begin();
   palette[0] = matrix4.Color(0,0,0);        //No color
// palette[1] = matrix.Color(0,0,255);       //blue
   palette[2] = matrix3.Color(255,0,255);    //purple
// palette[3] = matrix.Color(0,255,0);       //green
// palette[4] = matrix.Color(255,255,255);   //white
// palette[5] = matrix.Color(255,0,0);       //red
   palette[6] = matrix1.Color(0,255,255);    //yellow 
   palette[7] = matrix2.Color(255,255,0);    //cyan
  pinMode(button,INPUT_PULLUP);
}
void loop() {
   int newstate=digitalRead(button);
     if(newstate == LOW){
   float nvol = 0;
   int previous_peak = -1;
   for (int i = 0; i       auto analog = analogRead(A7);
       auto micline = abs(analog - 512);
       nvol = max(micline, nvol);
   }
   vol = (nvol + 1.0*vol)/2.0;
   if(nvol > 200){
       pop_detection += 1;
       if(pop_detection > 5) {
           smiling = false;
           last_face = millis();
       }
   } else {
       if(pop_detection > 0 && pop_detection <= 5) {
           if(millis() > last_face + 500){
               smiling = true;
               smiletimer = millis() + 2000;
           }
       }
       pop_detection = 0;
   }
   if(millis() > smiletimer) 
   smiling = false;
     if(smiling){
       drawImage(mouth_smile);
   } else if(vol < 200){
       drawImage(mouth_0);
   } else if(vol < 250 && vol > 200){
       drawImage(mouth_1); 
   } else if(vol < 350 && vol > 250){
       drawImage(mouth_2);
   } else if(vol < 450 && vol > 350){
       drawImage(mouth_3);
   } else {
       drawImage(mouth_4);
       }
     }
     else
     {
       drawImage(off_set);
     }
}
;>

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數(shù)據(jù)手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風(fēng)口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發(fā)指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應(yīng)用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應(yīng)用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關(guān)電源設(shè)計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數(shù)字電路基礎(chǔ)pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅(qū)動電路設(shè)計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學(xué)會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費