ds18b20数字温度计使用(编辑修改稿)内容摘要:

0xfb,0xf7, 0xef,0xdf,0xbf,0x7f}。 unsigned char code displaycode[]={0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71,0x00,0x40}。 unsigned char code dotcode[32]={0,3,6,9,12,16,19,22, 25,28,31,34,38,41,44,48, 50,53,56,59,63,66,69,72, 75,78,81,84,88,91,94,97}。 unsigned char displaycount。 unsigned char displaybuf[8]={16,16,16,16,16,16,16,16}。 unsigned char timecount。 unsigned char readdata[8]。 sbit DQ=P3^7。 bit sflag。 bit resetpulse(void) { unsigned char i。 DQ=0。 for(i=255。 i0。 i)。 DQ=1。 for(i=60。 i0。 i)。 return(DQ)。 for(i=200。 i0。 i)。 } void writemandtods18b20(unsigned char mand) { unsigned char i。 unsigned char j。 for(i=0。 i8。 i++) { if((mand amp。 0x01)==0) { DQ=0。 for(j=35。 j0。 j)。 DQ=1。 } else { DQ=0。 for(j=2。 j0。 j)。 DQ=1。 for(j=33。 j0。 j)。 } mand=_cror_(mand,1)。 } } unsigned char readdat。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。