標題: 各位大佬,幫忙看一下下面的程序是怎么選定TLC2543輸入端口的 [打印本頁]

作者: gy2264458415    時間: 2018-3-7 15:11
標題: 各位大佬,幫忙看一下下面的程序是怎么選定TLC2543輸入端口的

各位大佬,幫忙看一下下面的程序是怎么選定TLC2543輸入端口的

sbit clk=P1^3;
sbit cs=P1^2;
sbit adtain=P1^1;  
sbit adtaout=P1^0;



void TLC2543(void
{uchar i;  
ad=0;  
clk=0;  
cs=0;   
for(i=0;i<12;i++)   
  {if(adtaout==1)ad=ad|0x01;   
   adtain=0;   
   clk=1;   
   clk=0;   
   ad<<=1;//   
   }   
cs=1;   
ad>>=1;//
ad=(ad*1000)/819;  
}






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1