SPI_DATA=(bit)(da&0x8000);Р?SPI_CLK=1;Р?da<<=1;Р?SPI_CLK=0;Р?}Р?CS_DA=1;Р?SPI_CLK=0;Р?for (i=0;i<12;i++);Р}Р/*-------拆数显示部分-----------*/ Рvoid?chai(double?shu)Р{ long zhengshu,xiao;Р uchar?chaishu[8],bb;Р uchar i;Р zhengshu=(long)shu;Р xiao=(int)((shu-zhengshu)*1000);Р chaishu[0]=zhengshu/10000000;Р chaishu[1]=zhengshu%10000000/1000000;Р chaishu[2]=zhengshu%1000000/100000;Р chaishu[3]=zhengshu%100000/10000;Р chaishu[4]=zhengshu%10000/1000;Р chaishu[5]=zhengshu%1000/100;Р chaishu[6]=zhengshu%100/10;Р chaishu[7]=zhengshu%10;Р for(i=0;i<8;i++)Р {Р if(chaishu[i]!=0)Р {Р break;Р }Р }Р for(i;i<8;i++)Р {Р write_data(0x30+chaishu[i]);Р }Р if(zhengshu==0)Р {Р write_data(0x30);Р }Р chaishu[0]=xiao/100;Р chaishu[1]=xiao%100/10;Р chaishu[2]=xiao%10;Р if(xiao!=0)Р {Р write_data(0x2e);Р for(i=2;i>0;i--)