【花雕动手做】ASRPRO语音识别(66)--英语语音识别开关led灯
ASRPRO-Plus开发板板子基本介绍
本例实验的LED模块:
1个电源LED,一个可控制LED(与KEY3共用引脚PA4)。
电原理图(红点处D5为可控制LED)
【花雕动手做】实验七十一:使用英语语音识别控制开关板载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);
}
生成模型与编译烧录
实验记录视频
https://www.bilibili.com/video/BV1sH4y1h7UN/?share_source=copy_web&vd_source=371a292a55e5ca9be994cbb4a86cc987
https://www.bilibili.com/video/BV1sH4y1h7UN/?share_source=copy_web&vd_source=371a292a55e5ca9be994cbb4a86cc987
页:
[1]