本帖最后由 驴友花雕 于 2023-11-4 18:29 编辑
实验之九:语音控制的变换时钟数码管
实验开源代码
- #include "asr.h"
- extern "C"{ void * __dso_handle = 0 ;}
- #include "setup.h"
- #include "myLib/asr_event.h"
- #include "myLib/asr_tm1650.h"
-
- uint32_t snid;
- void hardware_init();
-
- //{ID:250,keyword:"命令词",ASR:"最大音量",ASRTO:"音量调整到最大"}
- //{ID:251,keyword:"命令词",ASR:"中等音量",ASRTO:"音量调整到中等"}
- //{ID:252,keyword:"命令词",ASR:"最小音量",ASRTO:"音量调整到最小"}
- TM1650 tm1650_11_12(11,12);
- void ASR_CODE()
- {
- //{ID:500,keyword:"命令词",ASR:"点亮一二三四",ASRTO:"已显示"}
- if(snid == 500){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(1234);
- }
- //{ID:501,keyword:"命令词",ASR:"两个八",ASRTO:"好的"}
- if(snid == 501){
- tm1650_11_12.clear_bit((1));
- }
- //{ID:502,keyword:"命令词",ASR:"点亮五六七八",ASRTO:"已显示"}
- if(snid == 502){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(5678);
- }
- //{ID:503,keyword:"命令词",ASR:"一个八",ASRTO:"好的"}
- if(snid == 503){
- tm1650_11_12.clear_bit((2));
- }
- //{ID:504,keyword:"命令词",ASR:"零点一",ASRTO:"好的"}
- if(snid == 504){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(1);
- tm1650_11_12.display_bit((0),(2),(1));
- }
- //{ID:505,keyword:"唤醒词",ASR:"智能管家",ASRTO:"我在呢"}
- if(snid == 505){
- tm1650_11_12.clear();
- digital_write(4,0);
- }
- //{ID:506,keyword:"命令词",ASR:"都没了",ASRTO:"好的"}
- if(snid == 506){
- tm1650_11_12.clear_bit((3));
- }
- //{ID:507,keyword:"命令词",ASR:"点亮数码管",ASRTO:"全部点亮"}
- if(snid == 507){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(8888);
- }
- //{ID:508,keyword:"命令词",ASR:"零点二",ASRTO:"好的"}
- if(snid == 508){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(2);
- tm1650_11_12.display_bit((0),(2),(1));
- }
- //{ID:509,keyword:"命令词",ASR:"三个八",ASRTO:"好的"}
- if(snid == 509){
- tm1650_11_12.clear_bit((4));
- }
- //{ID:510,keyword:"命令词",ASR:"六点二十二分",ASRTO:"过去了"}
- if(snid == 510){
- tm1650_11_12.clear();
- tm1650_11_12.display_time(6,22,(1));
- }
- //{ID:511,keyword:"命令词",ASR:"关闭数码管",ASRTO:"已关闭"}
- if(snid == 511){
- tm1650_11_12.clear();
- }
- //{ID:512,keyword:"命令词",ASR:"七",ASRTO:"好多七"}
- if(snid == 512){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(7777);
- }
- //{ID:513,keyword:"命令词",ASR:"十点十分",ASRTO:"正当时"}
- if(snid == 513){
- tm1650_11_12.clear();
- tm1650_11_12.display_time(10,10,(1));
- }
- //{ID:514,keyword:"命令词",ASR:"关闭灯光",ASRTO:"灯光已关闭"}
- if(snid == 514){
- digital_write(4,1);
- }
- //{ID:515,keyword:"命令词",ASR:"九",ASRTO:"好多九"}
- if(snid == 515){
- tm1650_11_12.clear();
- tm1650_11_12.display_num(9999);
- }
- //{ID:516,keyword:"命令词",ASR:"十二点三十四分",ASRTO:"要订闹钟吗"}
- if(snid == 516){
- tm1650_11_12.clear();
- tm1650_11_12.display_time(12,34,(1));
- }
- //{ID:517,keyword:"命令词",ASR:"还行",ASRTO:"谢谢鼓励"}
- if(snid == 517){
-
- }
- }
-
- void hardware_init(){
- tm1650_11_12.begin();
- vTaskDelete(NULL);
- }
-
- void setup()
- {
- //{speak:阿栋-浑厚男声,vol:20,speed:10,platform:haohaodada}
- //{playid:10001,voice:欢迎使用人工智能AI语音助手,用智能管家唤醒我}
- //{playid:10002,voice:我要退下了,用智能管家唤醒我}
- xTaskCreate(hardware_init,"hardware_init",256,NULL,100,NULL);
- }
复制代码
天问Block(标准模式)训练模型与编译烧录
实验动图
实验记录视频
[url=https://www.bilibili.com/video/B ... a9be994cbb4a86cc987]https://www.bilibili.com/video/B ... a9be994cbb4a86cc987[/url]
|