CanSensor.c
532 Bytes
#include "CanSensor.h"
u8 MusicSet[] = {0x23,0x00,0x01,0x00,0x00,0x00,0x00,0x00};
void Music_Select(u8 MusicS,u8 Vol)
{
static int LastTime = 0;
if(agv.Public.SystemTime - LastTime > 500)
{
LastTime = agv.Public.SystemTime;
if(agv.Command.Music_ONOFF)//屏幕输入参数,控制音乐开关
{
MusicSet[5] = MusicS;
MusicSet[6] = Vol;
CAN2_Send_Msg(0x60A,MusicSet, 8, 0);//给音乐模块发送指令
}
else
{
MusicSet[5] = MusicS;
MusicSet[6] = 0;
CAN2_Send_Msg(0x60A,MusicSet, 8, 0);//给音乐模块发送指令
}
}
}