• 大小: 85KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-07-02
  • 语言: C/C++
  • 标签: SHT11  12864  at89c51  proteus  

资源简介

这是一个以AT89C51为核心,以SHT11温湿度传感器和12864液晶为主要器件的温湿度上下限可调的报警器。用C语言编写程序。

资源截图

代码片段和文件信息

#include 
#include 
#include     //Keil library  
#include    //Keil library
#define uchar unsigned char
#define uint unsigned int
#define IO P2
#define noACK 0
#define ACK   1
                               //adr   command   r/w
#define STATUS_REG_W  0x06   //000    0011          0
#define STATUS_REG_R  0x07   //000    0011          1
#define MEASURE_TEMP  0x03   //000    0001          1
#define MEASURE_HUMI  0x05   //000    0010          1
#define RESET         0x1e   //000    1111          0

sbit DATA=P3^7;
sbit SCK=P3^6;
sbit E=P3^0;
sbit RW=P3^1;
sbit RS=P3^2;
sbit CS2=P3^4;
sbit CS1=P3^5;
sbit SetTempMax=P1^0;
sbit SetTempMin=P1^1;
sbit SetHumiMax=P1^2;
sbit SetHumiMin=P1^3;
sbit NumInc=P1^4;
sbit NumDec=P1^5;
sbit isOK=P1^6;
sbit TongFen=P0^0;
sbit DianLou=P0^1;
sbit JuanLian=P0^2;
sbit JiaShui=P0^3;



typedef union 
{ unsigned int i;
  float f;
} value;
//----------------------------------------------------------------------------------
// modul-var
//----------------------------------------------------------------------------------
enum {TEMPHUMI};
uchar code blank[]={0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00};/*“  “0*/

uchar code she[]={
0x400x400x420xCC0x000x400xA00x9E
0x820x820x820x9E0xA00x200x200x00
0x000x000x000x3F0x900x880x400x43
0x2C0x100x280x460x410x800x800x00};/*“设“0*/

uchar code ding[]={
0x100x0C0x440x440x440x440x450xC6
0x440x440x440x440x440x140x0C0x00
0x800x400x200x1E0x200x400x400x7F
0x440x440x440x440x440x400x400x00};/*“定“1*/

uchar code wen[]={
0x100x600x020x8C0x000x000xFE0x92
0x920x920x920x920xFE0x000x000x00
0x040x040x7E0x010x400x7E0x420x42
0x7E0x420x7E0x420x420x7E0x400x00};/*“温“0*/
uchar code du[]={
0x000x000xFC0x240x240x240xFC0x25
0x260x240xFC0x240x240x240x040x00
0x400x300x8F0x800x840x4C0x550x25
0x250x250x550x4C0x800x800x800x00};/*“度“1*/
uchar code shi[]={
0x100x600x020x8C0x000xFE0x920x92
0x920x920x920x920xFE0x000x000x00
0x040x040x7E0x010x440x480x500x7F
0x400x400x7F0x500x480x440x400x00};/*“湿“2*/
uchar code shang[]={
0x000x000x000x000x000x000xFF0x40
0x400x400x400x400x400x000x000x00
0x400x400x400x400x400x400x7F0x40
0x400x400x400x400x400x400x400x00};/*“上“3*/
uchar code xia[]={
0x020x020x020x020x020x020xFE0x02
0x020x420x820x020x020x020x020x00
0x000x000x000x000x000x000xFF0x00
0x000x000x000x010x060x000x000x00};/*“下“4*/
uchar code xian[]={
0x000xFE0x220x5A0x860x000xFE0x92
0x920x920x920x920xFE0x000x000x00
0x000xFF0x040x080x070x000xFF0x40
0x200x030x0C0x140x220x410x400x00};/*“限“5*/

uchar code number[11][16]={
{0x000xE00x100

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     105437  2013-06-01 10:53  006.DSN

     文件       1081  2013-07-03 15:20  006.PWI

     文件     105437  2013-06-01 10:14  Last Loaded 006.DBK

     文件      39427  2013-06-01 10:49  pro1

     文件      18401  2013-06-01 10:49  pro1.c

     文件      14369  2013-06-01 10:49  pro1.hex

     文件         40  2013-06-01 10:49  pro1.lnp

     文件      38102  2013-06-01 10:49  pro1.LST

     文件      46807  2013-06-01 10:49  pro1.M51

     文件      44998  2013-06-01 10:49  pro1.OBJ

     文件        988  2013-06-01 10:53  pro1.Opt

     文件          0  2013-06-27 15:23  pro1.plg

     文件       1678  2013-05-31 23:16  pro1.Uv2

    .......       993  2013-06-01 10:53  pro1_Opt.Bak

     文件       2083  2013-05-31 22:28  pro1_Uv2.Bak

----------- ---------  ---------- -----  ----

               419841                    15


评论

共有 条评论