程序在下面,其中cnt是我定义的变量,已经测试过cnt值是不断变化的,还有改程序显示固定值是没问题的- u8 size=0;
- u8 disp1[]="00";
- int main(void)
- {
- size=sizeof(disp1);
- while(1)
- {
- disp1[0]=cnt/10+48; //得到cnt的十位
- disp1[1]=cnt%10+48; //得到cnt的个位
- wr_cmd(0x80+0x00);//写命令
- wr_dat(disp1[0]);//写数据
- wr_dat(disp1[1]);//写数据
- delay_ms(5);
- }
- }
|