ASRPRO-Plus开发板
![【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯图3](https://mc.dfrobot.com.cn/data/attachment/forum/202402/10/202527a4h7t6stydawrtwt.jpg)
板子基本介绍
![【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯图2](https://mc.dfrobot.com.cn/data/attachment/forum/202402/10/202527l1a871o87ulttuiu.jpg)
本例实验的LED模块:
1个电源LED,一个可控制LED(与KEY3共用引脚PA4)。
电原理图(红点处D5为可控制LED)
![【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯图1](https://mc.dfrobot.com.cn/data/attachment/forum/202402/10/202527uugi6ic10xg155ix.jpg)
【花雕动手做】实验七十一:使用英语语音识别控制开关板载LED灯
实验开源代码
- #include "asr.h"
- extern "C"{ void * __dso_handle = 0 ;}
- #include "setup.h"
-
- uint32_t snid;
- void ASR_CODE();
-
- //{ID:250,keyword:"命令词",ASR:"MAX-VOICE",ASRTO:"Adjust the volume to maximum"}
- //{ID:251,keyword:"命令词",ASR:"MIDDLE-VOICE",ASRTO:"Adjust the volume to medium"}
- //{ID:252,keyword:"命令词",ASR:"MIN-VOICE",ASRTO:"Adjust the volume to the minimum"}
- /*描述该功能...
- */
- void ASR_CODE(){
- if((snid) == 4){
- digitalWrite(4,0);
- }
- if((snid) == 6){
- digitalWrite(4,1);
- }
-
- }
-
- void setup()
- {
- //{speak:Mia-英语女声,vol:20,speed:10,platform:haohaodada,version:V3}
- //{playid:10001,voice:Welcome to use SMART-HOUSEKEEPER and wake me up with LET-GO}
- //{playid:10002,voice:I left. Woke me up with LET-GO}
- //{ID:2,keyword:"唤醒词",ASR:"let go",ASRTO:"What are your orders, master"}
- //{ID:3,keyword:"唤醒词",ASR:"housekeeper",ASRTO:"I am here"}
- //{ID:4,keyword:"命令词",ASR:"ok",ASRTO:"All right, turn on the red light right now"}
- //{ID:6,keyword:"命令词",ASR:"no",ASRTO:"All right, turn off the red light now"}
- pinMode(4,output);
- setPinFun(4,FIRST_FUNCTION);
- }
复制代码
生成模型与编译烧录
![【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯图4](https://mc.dfrobot.com.cn/data/attachment/forum/202402/10/202837o5q3pfx555q3fzzb.jpg)
![【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯图5](https://mc.dfrobot.com.cn/data/attachment/forum/202402/10/202837ee5j5skku7glkzml.jpg)
实验记录视频
https://www.bilibili.com/video/BV1sH4y1h7UN/?share_source=copy_web&vd_source=371a292a55e5ca9be994cbb4a86cc987
![【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯图6](https://mc.dfrobot.com.cn/data/attachment/forum/202402/10/202837fyjedhbz227hezuf.jpg)
|