1 Star 0 Fork 8

li/20.9DSP大作业--小程序物联网8266DSP_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
整合0.txt 3.42 KB
一键复制 编辑 原始数据 按行查看 历史
zhiyu 提交于 2021-01-12 17:30 . v1.3
int start_flag=0; //接收到命令帧头 为1 2为接收完成
int order_num=0; //接收到第几个数据
char order[30]={0}; //用于存放接收到的命令 不包含头尾
int lost_flag=0; //用于在解析命令初始化时 丢弃数据避免卡死
int order1_flag=1; //声向 开关标志
int order1_time=30; //设置声向变化的间隔 越大越慢
int order1_dirnum=36; //设置运动方向的 0-35代表0-350度
int order3_flag=0; //混响 开关 1开
int order3_time=15; //混响时间的10倍 s
int order3_alpha=25; //alpha的100倍
是否直通 音量0-100 板载LED
#0,1,100,1*
Serial.print("#0,"+String(Bypass)+","+String(VOL_num)+","+String(LED_work)+"*");
//声向1 开关0/1 时间间隔 方向范围(从0开始) # *
#1,1,30,36*
//EQ2 总开关,lfc,lQ,lG rfc, rQ ,rG G加了50
#2,1,03000,2,50,08000,2,50*
//混响3 开关 混响时间rt60(10倍)s alpha值(100倍)
#3,1,12,25* 1.2s alpha=0.25;
微信小程序 使用MQTT 不用数据流 只需state!
//esp8266中上传
{\"V_sound\":String(V_sound_work),\"time\":String(time10ms),\"range\":String(range),
\" EQ\":String(EQ_work),\"1fc\":String(Lfc),\"1Q\":String(LQ),\"1G\":String(LG),\"2fc\":String(Rfc),\"2Q\":String(RQ),\"2G\":String(RG),
\" Reverb\":String(Reverb_work),\"rt60\":String(rt60),\"alpha\":String(alpha),
\" VOL_num\":String(VOL_num),\"Bypass\":String(Bypass),"LED":String(LED_work)}
SendMQTT_onevalue("state:","{\"V_sound\":"+String(V_sound_work)+",\"time\":"+String(time10ms)+",\"range\":"+String(range)+",\" EQ\":"+String(EQ_work)+",\"1fc\":"+String(Lfc)+",\"1Q\":"+String(LQ)+",\"1G\":"+String(LG)+",\"2fc\":"+String(Rfc)+",\"2Q\":"+String(RQ)+",\"2G\":"+String(RG)+",\" Reverb\":"+String(Reverb_work)+",\"rt60\":"+String(rt60)+",\"alpha\":"+String(alpha)+",\" VOL_num\":"+String(VOL_num)+",\"Bypass\":"+String(Bypass)+",\"LED\":"+String(LED_work)+ "}");
{"state":{"V_sound":0,"time":30,"range":36," EQ":0,"1fc":3000,"1Q":2,"1G":0,"2fc":8000,"2Q":2,"2G":0," Reverb":0,"rt60":1.20,"alpha":0.25," VOL_num":100,"Bypass":1,"LED":1}}
SendMQTT_onevalue("state:","[V_sound:"+String(V_sound_work)+",time:"+String(time10ms)+",range:"+String(range)+"],[EQ:"+String(EQ_work)+",1fc:"+String(Lfc)+",1Q:"+String(LQ)+",1G:"+String(LG)+",2fc:"+String(Rfc)+",2Q:"+String(RQ)+",2G:"+String(RG)+"],[Reverb:"+String(Reverb_work)+",rt60:"+String(rt60)+",alpha:"+String(alpha)+"],[VOL_num:"+String(VOL_num)+",Bypass:"+String(Bypass)+",LED:"+String(LED_work)+ "]");
String(alpha)
变量设置 单片机中
bool Bypass=1,LED_work=1; //直通? 板子led
int VOL_num=100; //音量
bool V_sound_work=0; //是否工作
int time10ms=30,range=36; //设置延时时间、范围
bool EQ_work=0;
int Lfc=3000,LQ=2,LG=0; //频率 Q 增益(发送给单片机要加50!)
int Rfc=8000,RQ=2,RG=0;
bool Reverb_work=0;
int rt60=12,alpha=25; //混响时间s(发送*10) alpha (发送*100)
注意GAIN要+50 在微信中
下发命令的参量 不加_work 跟state中一致
Bypass=1,LED=1; //直通? 板子led
VOL_num=100; //音量
V_sound=0; //是否工作
time=30,range=36; //设置延时时间、范围
EQ=0;
1fc=3000,1Q=2,1G=0; //频率 Q 增益(发送给单片机要加50!)
2fc=8000,2Q=2,2G=0;
Reverb=0;
rt60=12,alpha=25; //混响时间s(发送*10) alpha (发送*100)
//注意发送给单片机的 长度、小数!!
function0=0,function1=0,function2=0,function3=0; //用于 标记合并发送串口命令的 发给DSP
http://api.heclouds.com/devices/621408218/datapoints?type=3
Q=hrPLlim1GlHZCUhLJVqVS4Xvs=
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/lzh1762/dsp_20.9_1.git
git@gitee.com:lzh1762/dsp_20.9_1.git
lzh1762
dsp_20.9_1
20.9DSP大作业--小程序物联网8266DSP_1
master

搜索帮助