qinkaiabc 发表于 2014-5-19 21:27
程序包发上来。看看
#include "msp430g2553.h"
#include"12864.h"
const unsigned char tishi_W[]={"温度:"};
const unsigned char tishi_Wd[]={"°"};
const unsigned char temp_h[]={"温度高!"};
const unsigned char temp_l[]={"温度低!"};
const unsigned char tishi_S[]={"湿度:"};
const unsigned char tishi_Sd[]={"%"};
const unsigned char tishi_dot[]={"."};
const unsigned char humd_h[]={"湿度高!"};
const unsigned char humd_l[]={"湿度低!"};
const unsigned char w_shiyi[]={"温度在合适范围!"};
const unsigned char s_shiyi[]={"湿度在合适范围!"};
const unsigned char w_sx[]={"温度上限:"};
const unsigned char w_xx[]={"温度下限:"};
const unsigned char s_sx[]={"湿度上限:"};
const unsigned char s_xx[]={"湿度下限:"};
unsigned char temp_h_l=26;
unsigned char temp_l_l=18;
unsigned char humd_h_l=60;
unsigned char humd_l_l=40;
unsigned char temph,templ,humdh,humdl,check,counter;
unsigned char *th_p,*tl_p,*hh_p,*hl_p;
#define CPU (1000000)
#define delay_us(x) (__delay_cycles((double)x*CPU/1000000.0))
#define delay_ms(x) (__delay_cycles((double)x*CPU/1000.0))
#define HIGH P1OUT|= BIT5;
#define LOW P1OUT &=~BIT5;
#define SET P2IN&=BIT2
#define ADD P2IN&=BIT0
#define DEC P2IN&=BIT1
void show_Wendu();
void show_Shidu();
void show_tishi();
void tiaojie();
void FMQ_ON();
/*void DelayNus(unsigned int n) //延时Nus
{
unsigned int i;
for(i = n;i > 0;i--)
_NOP();
}*/
char receive(void) //接受函数
{
unsigned char num=0,tem,cnt; //临时变量用于存储接受数据
for(cnt=0;cnttemp_h_l&&humdh