时间的数据为BCD码,我该如何实现分钟的递减啊

[复制链接]
368|0
 楼主| 哈金 发表于 2018-7-1 12:16 | 显示全部楼层 |阅读模式
BCD, TI, AC, dc, RS
unsigned char StopTime[6]={0x99,0x04,0x17,0x12,0x20,0x01};//BCD码 时间99-04-17 12-20-01

void PtrStopTimeMin(int m,unsigned char buf[])
{
  int i;
  char out[2];
  for(i=4;i<5;i++)// ´òÓ¡·Ö
  {
   char t_H;
   char t_L;
  
   out[0]=(buf>>4)+0x30;
   out[1]=(buf&0x0f)+0x30;
   
   send_data_uart1(out[0]);
   send_data_uart1(out[1]);
  }
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

432

主题

433

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部