本例实验采用红外对管
该传感器模块对环境光线适应能力强,其有一对红外线发射与接收管,发射管发射出一定频率的红外线,当检测方向遇到障碍物(反射面)时,红外线反射回来被接收管接收,经过比较器电路处理之后,绿色指示灯会亮起,同时信号输出接口输出数字信号(一个低电平信号),可通过电位器旋钮调节检测距离,有效距离范围 2~30cm,工作电压为 3.3V-5V。该传感器的探测距离可以通过电位器调节、具有干扰小、便于装配、使用方便等特点,可以广泛应用于机器人避障、避障小车、流水线计数及黑白线循迹等众多场合。
红外避障模块电原理图
本例实验使用光敏电阻模块
光敏电阻模块参数:
工作电压:DC3.3-5V
光敏电阻型号:5516
模块针脚:3针或4针(4针的多出一个模拟输出端A0)
电原理图
本例实验使用四路继电器模块
四路继电器模块是一种可以通过单片机或其他数字信号控制的开关模块,它可以实现对高电压或高电流设备的开关控制。
四路继电器模块的电原理如图。
【花雕动手做】实验五十五:携带式语音整合控制的四路智能管家盒子
实验开源代码
#include "asr.h"
extern "C"{ void * __dso_handle = 0 ;}
#include "setup.h"
#include "myLib/asr_event.h"
uint32_t snid;
void ASR_CODE();
void hardware_init();
/*描述该功能...
*/
void ASR_CODE(){
set_state_enter_wakeup(15000);
switch (snid) {
case 0:
digitalWrite(4,0);
break;
case 1:
digitalWrite(2,0);
break;
case 2:
digitalWrite(2,1);
break;
case 3:
digitalWrite(3,0);
break;
case 4:
digitalWrite(3,1);
break;
case 5:
digitalWrite(5,0);
break;
case 6:
digitalWrite(5,1);
break;
case 7:
digitalWrite(6,0);
break;
case 8:
digitalWrite(6,1);
break;
case 9:
digitalWrite(2,0);
digitalWrite(3,0);
digitalWrite(5,0);
digitalWrite(6,0);
break;
case 10:
digitalWrite(2,1);
digitalWrite(3,1);
digitalWrite(5,1);
digitalWrite(6,1);
break;
}
delay(100);
//{ID:500,keyword:"命令词",ASR:"效果不错",ASRTO:"有你的鼓励挺好,谢谢"}
if(snid == 500){
}
}
//{ID:250,keyword:"命令词",ASR:"最大音量",ASRTO:"音量调整到最大"}
//{ID:251,keyword:"命令词",ASR:"中等音量",ASRTO:"音量调整到中等"}
//{ID:252,keyword:"命令词",ASR:"最小音量",ASRTO:"音量调整到最小"}
void sys_sleep_hook()
{
digitalWrite(4,1);
}
void hardware_init(){
pinMode(18,input);
dpmu_set_adio_reuse(PA0,DIGITAL_MODE);
dpmu_set_io_pull(pinToFun[0],DPMU_IO_PULL_UP);
setPinFun(0,SECOND_FUNCTION);
pinMode(1,input);
dpmu_set_adio_reuse(PA1,DIGITAL_MODE);
dpmu_set_io_pull(pinToFun[1],DPMU_IO_PULL_UP);
setPinFun(1,FIRST_FUNCTION);
while (1) {
if(!(digitalRead(0))){
digitalWrite(2,0);
delay(200);
enter_wakeup(2000);
delay(200);
//{ID:501,keyword:"命令词",ASR:"耍接官",ASRTO:"天亮了,打开窗帘"}
play_audio(501);
delay(5000);
}
if(!(digitalRead(1))){
digitalWrite(3,0);
delay(200);
enter_wakeup(2000);
delay(200);
//{ID:502,keyword:"命令词",ASR:"接耍官",ASRTO:"入侵报警,打开警报灯,大家集合"}
play_audio(502);
delay(5000);
}
delay(100);
}
vTaskDelete(NULL);
}
void setup()
{
//{speak:小爱-活泼女声,vol:18,speed:10,platform:haohaodada,version:V3}
//{playid:10001,voice:欢迎使用人工智能AI语音助手,用智能管家唤醒我}
//{playid:10002,voice:我退下了}
//{ID:0,keyword:"唤醒词",ASR:"智能管家",ASRTO:"我在"}
//{ID:1,keyword:"命令词",ASR:"打开窗帘",ASRTO:"已打开"}
//{ID:2,keyword:"命令词",ASR:"关闭窗帘",ASRTO:"已关闭"}
//{ID:3,keyword:"命令词",ASR:"打开警报灯",ASRTO:"已打开"}
//{ID:4,keyword:"命令词",ASR:"关闭警报灯",ASRTO:"已关闭"}
//{ID:5,keyword:"命令词",ASR:"打开空调",ASRTO:"已打开"}
//{ID:6,keyword:"命令词",ASR:"关闭空调",ASRTO:"已关闭"}
//{ID:7,keyword:"命令词",ASR:"打开电视机",ASRTO:"已打开"}
//{ID:8,keyword:"命令词",ASR:"关闭电视机",ASRTO:"已关闭"}
//{ID:9,keyword:"命令词",ASR:"全部打开",ASRTO:"测试打开所有家电"}
//{ID:10,keyword:"命令词",ASR:"全部关闭",ASRTO:"关闭所有家电"}
pinMode(4,output);
digitalWrite(4,1);
pinMode(2,output);
digitalWrite(2,1);
pinMode(3,output);
digitalWrite(3,1);
pinMode(5,output);
digitalWrite(5,1);
pinMode(6,output);
digitalWrite(6,1);
xTaskCreate(hardware_init,"hardware_init",256,NULL,100,NULL);
}
生成模型与编译烧录
实验记录视频
https://www.bilibili.com/video/BV1wk4y1S7GT/?share_source=copy_web&vd_source=371a292a55e5ca9be994cbb4a86cc987
实验五十五:携带式语音整合控制的四路智能管家盒子文章来源:https://www.toymoban.com/news/detail-835379.html
附录系列实验:
【花雕动手做】ASRPRO-Plus语音识别(01)—开发板三种开发环境的搭建
https://blog.csdn.net/weixin_41659040/article/details/133909855
【花雕动手做】ASRPRO-Plus语音识别(02)—核心芯片、参数与电原理图
https://blog.csdn.net/weixin_41659040/article/details/133900928
【花雕动手做】ASRPRO-Plus语音识别(03)—板载硬件和12项应用功能
https://blog.csdn.net/weixin_41659040/article/details/133970323
【花雕动手做】ASRPRO-Plus语音识别(04)—控制点亮与闪烁板载LED
https://blog.csdn.net/weixin_41659040/article/details/134020401
【花雕动手做】ASRPRO-Plus语音识别(05)—WS2812B的点亮和变色
https://blog.csdn.net/weixin_41659040/article/details/134185082
【花雕动手做】ASRPRO-Plus语音识别(06)—点亮TM1650四位数码管
https://blog.csdn.net/weixin_41659040/article/details/134207483
【花雕动手做】ASRPRO-Plus语音识别(06)—会数数的语音控制数码管
https://blog.csdn.net/weixin_41659040/article/details/134214086
【花雕动手做】ASRPRO-Plus语音识别(07)—点亮ST7735的1.77TFT彩屏
https://blog.csdn.net/weixin_41659040/article/details/134308542
【花雕动手做】ASRPRO-Plus语音识别(08)— PT0603光敏三极管
https://blog.csdn.net/weixin_41659040/article/details/135009618
【花雕动手做】ASRPRO-Plus语音识别(09)— DTH11数字式温湿度传感器
https://blog.csdn.net/weixin_41659040/article/details/135022999
【花雕动手做】ASRPRO语音识别(10)—实时测亮度、温湿度的智能气象站
https://blog.csdn.net/weixin_41659040/article/details/135046594
【花雕动手做】ASRPRO-Plus语音识别(11)—TM1650数码管显示温湿度
https://blog.csdn.net/weixin_41659040/article/details/135049040
【花雕动手做】ASRPRO语音识别(12)—ST7735彩屏显示英文与中文
https://blog.csdn.net/weixin_41659040/article/details/135082849
【花雕动手做】ASRPRO语音识别(13)—1.8寸彩屏显示大字号中文
https://blog.csdn.net/weixin_41659040/article/details/135091398
【花雕动手做】ASRPRO语音识别(14)—ST7735彩屏显示环境亮度
https://blog.csdn.net/weixin_41659040/article/details/135165021
【花雕动手做】ASRPRO语音识别(15)—1.8寸彩屏显示字号变换
https://blog.csdn.net/weixin_41659040/article/details/135170449
【花雕动手做】ASRPRO语音识别(16)—1.8寸彩屏连续显示亮度
https://blog.csdn.net/weixin_41659040/article/details/135193729
【花雕动手做】ASRPRO语音识别(17)—按键控制彩屏和继电器
https://blog.csdn.net/weixin_41659040/article/details/135232092
【花雕动手做】ASRPRO语音识别(18)—按键和语音控制彩屏变色
https://blog.csdn.net/weixin_41659040/article/details/135239614
【花雕动手做】ASRPRO语音识别(19)—语音和按键控制继电器
https://blog.csdn.net/weixin_41659040/article/details/135298357
【花雕动手做】ASRPRO语音识别(20)—彩屏显示DHT11温湿度
https://blog.csdn.net/weixin_41659040/article/details/135327244
【花雕动手做】ASRPRO语音识别(21)—报亮度温湿度的气象站
https://blog.csdn.net/weixin_41659040/article/details/135327217
【花雕动手做】ASRPRO语音识别(22)—红外对管控制TFT彩屏
https://blog.csdn.net/weixin_41659040/article/details/135347986
【花雕动手做】ASRPRO语音识别(23)—智能红外感应迎宾员
https://blog.csdn.net/weixin_41659040/article/details/135347986
【花雕动手做】ASRPRO语音识别(24)—PT0603光敏控制屏幕
https://blog.csdn.net/weixin_41659040/article/details/135363986
【花雕动手做】ASRPRO语音识别(25)—红外触发的火星基地介绍
https://blog.csdn.net/weixin_41659040/article/details/135379228
【花雕动手做】ASRPRO语音识别(26)—智能对话带唤醒指示灯
https://blog.csdn.net/weixin_41659040/article/details/135416883
【花雕动手做】ASRPRO语音识别(27)—语音0#串口输出字符串
https://blog.csdn.net/weixin_41659040/article/details/135474110
【花雕动手做】ASRPRO语音识别(28)—串口0#输出十六进制数
https://blog.csdn.net/weixin_41659040/article/details/135518931
【花雕动手做】ASRPRO语音识别(29)—0#串口命令控制继电器
https://blog.csdn.net/weixin_41659040/article/details/135526210
【花雕动手做】ASRPRO语音识别(30)–串口0接收字符串打开灯
https://blog.csdn.net/weixin_41659040/article/details/135528064
【花雕动手做】ASRPRO语音识别(31)—语音控制四位继电器
https://blog.csdn.net/weixin_41659040/article/details/135548136
【花雕动手做】ASRPRO语音识别(32)–简版四路继电器语音控制
https://blog.csdn.net/weixin_41659040/article/details/135559483
【花雕动手做】ASRPRO语音识别(33)–语音驱动8位 WS2812B直条
https://blog.csdn.net/weixin_41659040/article/details/135569390
【花雕动手做】ASRPRO语音识别(34)–WS2812B直条彩虹呼吸灯
https://blog.csdn.net/weixin_41659040/article/details/135572438
【花雕动手做】ASRPRO语音识别(35)–串口16进数打开继电器
https://blog.csdn.net/weixin_41659040/article/details/135579138
【花雕动手做】ASRPRO语音识别(36)–流光溢彩和随机LED灯
https://blog.csdn.net/weixin_41659040/article/details/135580651
【花雕动手做】ASRPRO语音识别(37)—语音18B20 数字温度计
https://blog.csdn.net/weixin_41659040/article/details/135584232
【花雕动手做】ASRPRO语音识别(38)—连续读取18B20温度值
https://blog.csdn.net/weixin_41659040/article/details/135436834
【花雕动手做】ASRPRO语音识别(39)–语音控制SG90舵机模块
https://blog.csdn.net/weixin_41659040/article/details/135607093
【花雕动手做】ASRPRO语音识别(40)—SG90 舵机与板载彩屏
https://blog.csdn.net/weixin_41659040/article/details/135621548
【花雕动手做】ASRPRO语音识别(41)—64位WS2812B点阵屏模块
https://blog.csdn.net/weixin_41659040/article/details/135624709
【花雕动手做】ASRPRO语音识别(42)–语音彩屏光敏电阻测光
https://blog.csdn.net/weixin_41659040/article/details/135645417
【花雕动手做】ASRPRO语音识别(43)–64位WS2812屏流光彩虹灯
https://blog.csdn.net/weixin_41659040/article/details/135651589
【花雕动手做】ASRPRO语音识别(44)—光敏电阻光控继电器
https://blog.csdn.net/weixin_41659040/article/details/135659665
【花雕动手做】ASRPRO语音识别(45)—红外光敏双模块感控
https://blog.csdn.net/weixin_41659040/article/details/135664326
【花雕动手做】ASRPRO语音识别(46)—四路继电器的智能控制
https://blog.csdn.net/weixin_41659040/article/details/135682166
【花雕动手做】ASRPRO语音识别(47)—智能对话聊天的白盒子
https://blog.csdn.net/weixin_41659040/article/details/135725705
【花雕动手做】ASRPRO语音识别(48)—用N20电机的苗条小车
https://blog.csdn.net/weixin_41659040/article/details/135729615
【花雕动手做】ASRPRO语音识别(49)—尝试使用GPIO口中断
https://blog.csdn.net/weixin_41659040/article/details/135812731
【花雕动手做】ASRPRO语音识别(50)—四路集控智能管家盒子
https://blog.csdn.net/weixin_41659040/article/details/135812984
【花雕动手做】ASRPRO语音识别(51)—定时器单次和重复运行
https://blog.csdn.net/weixin_41659040/article/details/135873988
【花雕动手做】ASRPRO语音识别(52)—硬件定时器的快慢闪灯
https://blog.csdn.net/weixin_41659040/article/details/135879389
【花雕动手做】ASRPRO语音识别(53)—串口设置与输出显示
https://blog.csdn.net/weixin_41659040/article/details/135880166
【花雕动手做】ASRPRO语音识别(54)—MG996R金属齿轮舵机
https://blog.csdn.net/weixin_41659040/article/details/135891795
【花雕动手做】ASRPRO语音识别(55)—串口输出16制与字符串
https://blog.csdn.net/weixin_41659040/article/details/135896818
【花雕动手做】ASRPRO语音识别(56)—语音PWM调节LED灯亮度
https://blog.csdn.net/weixin_41659040/article/details/135891776
【花雕动手做】ASRPRO语音识别(57)—语音MG996R舵机与彩屏
https://blog.csdn.net/weixin_41659040/article/details/135905626
【花雕动手做】ASRPRO语音识别(58)—尝试自学习模式开关灯
https://blog.csdn.net/weixin_41659040/article/details/135927456
【花雕动手做】ASRPRO语音识别(59)—科普航母模型小智盒子
https://blog.csdn.net/weixin_41659040/article/details/135941503
【花雕动手做】ASRPRO语音识别(60)—软件定时器控制变色灯
https://blog.csdn.net/weixin_41659040/article/details/135975657
【花雕动手做】ASRPRO语音识别(61)—童声对话版的鼠标精灵
https://blog.csdn.net/weixin_41659040/article/details/135975608
【花雕动手做】ASRPRO语音识别(62)—多线程控制背光和LED
https://blog.csdn.net/weixin_41659040/article/details/135985481
【花雕动手做】ASRPRO语音识别(63)—软件定时器开关板载灯
https://blog.csdn.net/weixin_41659040/article/details/135991857
【花雕动手做】ASRPRO语音识别(64)—串口和语音控制继电器
https://blog.csdn.net/weixin_41659040/article/details/136087432
【花雕动手做】ASRPRO语音识别(65)—语音TT电机PWM转速
https://blog.csdn.net/weixin_41659040/article/details/136091509
【花雕动手做】ASRPRO语音识别(66)–英语语音识别开关led灯
https://blog.csdn.net/weixin_41659040/article/details/136092396
【花雕动手做】ASRPRO语音识别(67)—彩屏语音PWM单电机
https://blog.csdn.net/weixin_41659040/article/details/136095179
【花雕动手做】ASRPRO语音识别(68)–语音灯板PWM照明盒子
https://blog.csdn.net/weixin_41659040/article/details/136101146
【花雕动手做】ASRPRO语音识别(69)—电机正反转PWM彩屏
https://blog.csdn.net/weixin_41659040/article/details/136107099
【花雕动手做】ASRPRO语音识别(70)—四点绿WS2812彩盒子
https://blog.csdn.net/weixin_41659040/article/details/136115133文章来源地址https://www.toymoban.com/news/detail-835379.html
到了这里,关于【花雕动手做】ASRPRO语音识别(50)---四路外控智能管家盒子的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!