|
楼主 |
发表于 2024-11-14 15:01:14
|
显示全部楼层
为什么我调用这函数这几个地址显示的是01,蜂鸣器还会响
u8 senddata[20] = {16,5,4,1,2};
void send_data_to_addresses()
{
u8 arr[20];
// 目标地址数组
u16 addresses[] = {0x7100,0x7200,0x7300,0x7400,0x7500};
u16 i =0;
u16 j =0;
for (i = 0; i < sizeof(addresses) / sizeof(addresses[0]); i++)
{
// 构造arr数组
arr[0] = DTHD1;
arr[1] = DTHD2;
arr[2] = 10;
arr[3] = 0x82;
arr[4] = (u8)(addresses >> 8);
arr[5] = (u8)(addresses);
for (j = 0; j < 5; j++)
{
arr[6 + j] = senddata[j];
}
// 调用deal_82_cmd函数进行数据传输
deal_82_cmd(2, arr);
}
}
|
|