ds18b20程序 lm386 超声波测距
writebyte(0xa0); respons(); writebyte(address); respons(); writebyte(date); respons(); stop(); void t0() interrupt 1 { uchar i; TH0=(65536-50000)/256; TL0=(65536-50000)%256; i++; if(i==20) }
uchar readbyte_add(uchar address) { uchar date; start(); writebyte(0xa0); respons(); writebyte(address); respons(); start(); writebyte(0xa1); respons(); date=readbyte(); stop(); return date; }
void main() { init(); sec=readbyte_add(2); if(sec>100) sec=0; TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; ET0=1; EA=1; TR0=1; while(1) { display(sec); if(write==1) writebyte_add(2,sec); } } { } }
i=0; write=1; sec++; if(sec==100) sec=0;
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库ds18b20程序 lm386 超声波测距(5)在线全文阅读。
相关推荐: