基于单片机多机通讯仓库测温报警系统设计
【资源下载】下载地址如下1383:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include <main.h> #include <18b20.h> //#include <485.h> sbit warning=P1^7; sbit greenled=P1^6;//485 收发控制 uchar flag1; // sign of the result positive or negative uchar j; uint temper[5]; sbit k1=P3^7; uchar flag; uchar code Tab[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; uint receive_data; uchar DH,DL; uchar flag; void delay(uint count) //delay { uint i; while(count) { i=200; while(i>0) i--; count--; } } void serial_int()//串口初始化 { TMOD=0X20;//t1工作在方式2 SM0=1;//串口工作在方式2 SM1=1; SM2=1;//使能rb8和TB8 REN=0;//不接受 TH1=0xF3;//2400BIT/S