ds18b20程序 lm386 超声波测距(2)

2021-02-21 08:42

ds18b20程序 lm386 超声波测距

delay1(1); writebyte(0xcc); writebyte(0xbe); a=readbyte(); b=readbyte(); temp=b; temp<<=8; temp=temp|a; f_temp=temp*0.0625; temp=f_temp*10+0.5; f_temp=f_temp+0.05; return temp; }

void warn(uchar s) { uchar i; i=s; c=1; b=0; a=1; wr=0; beep=1; wr=1; delay1(s); c=1; b=0; a=1; wr=0; beep=0; wr=1; i=s; delay1(s); }

void deal(uint t) { uchar i; if(t>250&t<=270) { warn(40); } else if(t<=250) { warn(10); } else if(t<320&t>300)

{ warn(40); } else if(t>=320) { warn(10); } else { i=40; delay1(i); } }

void main() { uint x; while(1) { change(); x=get_temp(); display(x); deal(x); } }


ds18b20程序 lm386 超声波测距(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:幼儿园教师如何讲故事

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: