完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
相关推荐
|
|
#include #define uint unsigned int #define uchar unsigned char ***it io=P2^5;//DHT11数据端 //***it wela=P2^7;// 数码管位选 //***it dula=P2^6;//数码管段选 ***it lcden=P3^7; ***it lcdrs=P3^4; ***it lcdrw=P3^6; uchar data_byte; uchar RH,RL,TH,TL,checkdata; uchar wendu; uchar shidu; //uchar table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98}; //uchar wei[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; void delay(uchar z) { uchar x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); } void delay1() //延时10us { uchar i; i--; i--; i--; i--; i--; i--; } void write_cmd(char cmd) //写指令函数 { lcdrs=0; lcden=0; P0=cmd; delay(1); lcden=1; delay(1); lcden=0; } void write_data(uchar dat) //写数据函数 { lcdrs=1; lcden=0; P0=dat ; delay(1); lcden=1; delay(1); lcden=0; } void write_str(uchar *str)//写字符串函数 { while(*str!=' |