18b20驱动用于51单片机.docVIP

  • 19
  • 0
  • 约9.05千字
  • 约 12页
  • 2018-05-22 发布于河南
  • 举报
18b20驱动用于51单片机

18B20驱动程序 作者:佚名 ?来源:不详 ?录入:Admin ?更新时间:2008-7-27 16:07:52 ?点击数:2 【字体: 】 /************************************************************ *18B20驱动程序,DQ为数据口,接于P2.1 *11.0592M晶振,上拉4.7k电阻 *Author:fyb *2005-3-25 11:23,OK! *************************************************************/ #includereg51.h #includeintrins.h #define uchar unsigned char #define uint? unsigned int sbit dq = P1^7; bit? flag; uint Temperature; uchar temp_buff[9]; //存储读取的字节,read scratchpad为9字节,read rom ID为8字节 uchar id_buff[8]; uchar *p; uchar crc_data; uchar code CrcTable [256]={ 0,? 94, 188,? 226,? 97,? 63,? 221,? 131,? 194,?

文档评论(0)

1亿VIP精品文档

相关文档