7496|5

304

帖子

0

TA的资源

一粒金砂(中级)

楼主
 

近期在做一个温湿度传感器采集,用1602液晶显示,在网上找了一个程序,一直读不到数. [复制链接]


/*2015-11-15*/

#ifndef __TOU_H__
#define __TOU_H__

#include
#include
//#include     //Keil library

sbit d=P1^5;
#define uint unsigned int
#define uchar unsigned char
enum {TEMP,HUMI};

sbit DATA = P1^1;
sbit SCK = P1^0;

sbit lcdrs=P0^0;                                                  
sbit lcdrw=P0^1;                                                   
sbit lcden=P0^2;
#define lcd_date P0
#define delay5us(){_nop_();_nop_();_nop_();_nop_();_nop_();}


/********     SHT10????      ********/
void s_connectionreset(void);
char s_measure(unsigned char *p_value, unsigned char *p_checksum, unsigned char mode);
void calc_sth10(float *p_humidity ,float *p_temperature);
//float calc_dewpoint(float h,float t);


#endif
/***********************************************************************************************************************************************************/

//SHT10??(SHT10.c):

//#include

#define noACK 0                                //??????,??????????
#define ACK   1             //??????;
                                                        //??  ??  ?/?
#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



//?????
char s_write_byte(unsigned char value)   
{
        unsigned char i,error=0;
        for (i=0x80;i>0;i>>=1)             //???1,????
        {
                if (i&value) DATA=1;          //????????,???????
            else DATA=0;                        
            SCK=1;                          
            _nop_();_nop_();_nop_();        //??3us
            SCK=0;
        }
        DATA=1;                           //?????
        SCK=1;                           
        error=DATA;                       //??????,??????
        _nop_();_nop_();_nop_();
        SCK=0;        
        DATA=1;
        return error;                     //error=1 ????
}

//?????
char s_read_byte(unsigned char ack)
//----------------------------------------------------------------------------------
{
        unsigned char i,val=0;
        DATA=1;                           //?????
        for(i=0x80;i>0;i>>=1)             //???1,????
        {
                SCK=1;                        
            if(DATA) val=(val|i);        //????????
            SCK=0;      
        }
        DATA=!ack;                        //?????,????????;
        SCK=1;                           
        _nop_();_nop_();_nop_();          //??3us
        SCK=0;   
        _nop_();_nop_();_nop_();      
        DATA=1;                           //?????
        return val;
}

//????
void s_transstart(void)
// generates a transmission start
//       _____         ________
// DATA:      |_______|
//           ___     ___
// SCK : ___|   |___|   |______
{
           DATA=1; SCK=0;                   //??
           _nop_();
          SCK=1;
           _nop_();
           DATA=0;
           _nop_();
          SCK=0;
           _nop_();_nop_();_nop_();
           SCK=1;
           _nop_();
          DATA=1;     
          _nop_();
           SCK=0;     
}


//????
void s_connectionreset(void)
// communication reset: DATA-line=1 and at least 9 SCK cycles followed by transstart
//       _____________________________________________________         ________
// DATA:                                                      |_______|
//          _    _    _    _    _    _    _    _    _        ___     ___
// SCK : __| |__| |__| |__| |__| |__| |__| |__| |__| |______|   |___|   |______
{
        unsigned char i;
        DATA=1; SCK=0;                    //??
        for(i=0;i<9;i++)                  //DATA???,SCK????9?,??????,?????
        {
                SCK=1;
            SCK=0;
        }
        s_transstart();                   //????
}


//?????
char s_softreset(void)
// resets the sensor by a softreset
{
        unsigned char error=0;
        s_connectionreset();              //??????
        error+=s_write_byte(RESET);       //??????
        return error;                     //error=1 ????
}


char s_read_statusreg(unsigned char *p_value, unsigned char *p_checksum)
//----------------------------------------------------------------------------------
// reads the status register with checksum (8-bit)
{
        unsigned char error=0;
        s_transstart();                   //transmission start
        error=s_write_byte(STATUS_REG_R); //send command to sensor
        *p_value=s_read_byte(ACK);        //read status register (8-bit)
        *p_checksum=s_read_byte(noACK);   //read checksum (8-bit)
        return error;                     //error=1 in case of no response form the sensor
}

//??????
char s_write_statusreg(unsigned char *p_value)
// writes the status register with checksum (8-bit)
{
        unsigned char error=0;
        s_transstart();                   //transmission start
        error+=s_write_byte(STATUS_REG_W);//send command to sensor
        error+=s_write_byte(*p_value);    //send value of status register
        return error;                     //error>=1 in case of no response form the sensor
}                                                                                                                                                  

//?????
char s_measure(unsigned char *p_value, unsigned char *p_checksum, unsigned char mode)
// ??????????,???mode??????;
{
//        enum {TEMP,HUMI};                 //?????????
        unsigned error=0;
        unsigned int i;

        s_transstart();                   //????
        switch(mode)                     //??????
    {       
                case TEMP : error+=s_write_byte(MEASURE_TEMP); break;                   //????
            case HUMI : error+=s_write_byte(MEASURE_HUMI); break;                   //????
            default     : break;
        }
        for (i=0;i<65535;i++) if(DATA==0) break; //??????
        if(DATA) error+=1;                // ????????????,??????
        *(p_value) =s_read_byte(ACK);    //??????,??? (MSB)
        *(p_value+1)=s_read_byte(ACK);    //??????,??? (LSB)
        *p_checksum =s_read_byte(noACK); //read CRC???
        return error;                                         // error=1 ????
}

//?????????????
void calc_sth10(float *p_humidity ,float *p_temperature)
{
        const float C1=-4.0;              // 12????? ????
        const float C2=+0.0405;           // 12????? ????
        const float C3=-0.0000028;        // 12????? ????
        const float T1=+0.01;             // 14????? 5V??  ????
        const float T2=+0.00008;          // 14????? 5V??  ????

        float rh=*p_humidity;             // rh:      12? ??
        float t=*p_temperature;           // t:       14? ??
        float rh_lin;                     // rh_lin: ?? linear?
        float rh_true;                    // rh_true: ?? ture?
        float t_C;                        // t_C   : ?? ?

        t_C=t*0.01 - 40;                  //????
        rh_lin=C3*rh*rh + C2*rh + C1;     //?????????
        rh_true=(t_C-25)*(T1+T2*rh)+rh_lin;   //?????????????
        if(rh_true>100)rh_true=100;       //??????
        if(rh_true<0.1)rh_true=0.1;       //??????

        *p_temperature=t_C;               //??????
        *p_humidity=rh_true;              //??????
}

//????????????
/*float calc_dewpoint(float h,float t)
{
        float logEx,dew_point;
        logEx=0.66077+7.5*t/(237.3+t)+(log10(h)-2);
        dew_point = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);
        return dew_point;
}                                                                                           */

/***********************************************************************************************************************************************************/
//DS1602??(1602.c):

//#include

//??????**************************************************************
void delayms(uchar x)
{
        uchar t;
        while(x--)
    for(t=0;t<120;t++);
}

//??????
void lcd_busy_wait()
{
uchar Hi,Lo;
        do
        {
                lcd_date |=0xf0;//4?????????????
                lcdrs=0;
                lcdrw=1;//??????? ?
                lcden=1;
                delay5us();
                Hi=lcd_date;
                delay5us();
                lcden=0;
                delay5us();
                lcden=1;
                delay5us();
                Lo=lcd_date;
                delay5us();
                lcden=0;
                delay5us();
        }
        while(Hi&0x80);
}

//???
void lcd_1602_write_com(uchar com)   
{
        lcd_busy_wait();//?????
        lcd_date=com&0xf0|0x04;//?????,?????rs,rw,en?????
        delay5us();
        lcden=0;
        delay5us();
        lcd_date=com<<4|0x04;//?????
        delay5us();
        lcden=0;
        delay5us();
}       

//???
void lcd_1602_write_dat(uchar dat)
{
        lcd_busy_wait();//?????
        lcd_date=dat&0xf0|0x05;//?????
        delay5us();
        lcden=0;
        delay5us();
        lcd_date=dat<<4|0x05;//?????
        delay5us();
        lcden=0;
        delay5us();
}       


//?????
void Lcd_1602_init()
{
        lcd_date=0xff;//?????????????
        lcd_date=0x24;//4???,?lcden,lcdrw,lcdrs=100(4),?????????
        lcden=0;//?????????

        lcd_1602_write_com(0x28); //4?,2?,5x7??          
          delayms(15);                          
          lcd_1602_write_com(0x0c); //???
        delayms(15);
        lcd_1602_write_com(0x06);  //?????,????
        delayms(15);          
          lcd_1602_write_com(0x01);//??
        delayms(15);
        lcd_1602_write_com(0x02);//????????
        delayms(15);
}       


void lcd_string(uchar r,uchar c,char *str)
{
        uchar i=0;
        code uchar ddram[]={0x80,0xc0};//???????????
         lcd_1602_write_com(ddram[r]|c);//????????
        //?????
        for(i=0;i<16&&str!= '\0';i++)
                {
                        lcd_1602_write_dat(str);
                }
}
/*
void GotoXY(unsigned char x, unsigned char y)
{
    if(y==0)
        lcd_1602_write_com(0,0x80|x);
    if(y==1)
        lcd_1602_write_com(0,0x80|(x-0x40));
}

//??????????
void Print(unsigned char *str)
{
    while(*str!='\0')
    {
      lcd_1602_write_dat(1,*str);
        str++;
    }
}
*/
/***********************************************************************************************************************************************************/
//???(main.c):

//#include

typedef union                                 //???????
{        
        unsigned int i;
        float f;
} value;

//????
void delay(int z)                //z????
{
        int x,y;
        for(x=z;x>0;x--)
                for(y=125;y>0;y--);
}


void main()
{
        unsigned int temp,humi;
        value humi_val,temp_val;                //???????,??????,??????
//        float dew_point;                            //???????
        unsigned char error;                    //??????????
        unsigned char checksum;                        //CRC                         
        uchar wendu[6];                                         //??????
        uchar shidu[6];                                         //??????
       
                                         
        Lcd_1602_init();                                           //?????                  
                   //GotoXY(0,0);                                           //????????
           //Print("TEMP:     %C");                           //5???
    //GotoXY(0,1);                                           //????????
           //Print("HUMI:     %RH");                           //5???
                lcd_string(0,0,"TEMP:     %C");
                delayms(50);
                lcd_string(1,0,"HUMI:     %RH");
        s_connectionreset();                           //??????

        while(1)
        {
                error=0;                                           //???error=0,?????
                error+=s_measure((unsigned char*)&temp_val.i,&checksum,TEMP); //????
                error+=s_measure((unsigned char*)&humi_val.i,&checksum,HUMI); //????
            if(error!=0){ s_connectionreset();   
        //d=0;
                                }
            else
            {
                                        d=0;
                        humi_val.f=(float)humi_val.i;                   //??????
                     temp_val.f=(float)temp_val.i;                   //??????
                     calc_sth10(&humi_val.f,&temp_val.f);            //?????????
//                   dew_point=calc_dewpoint(humi_val.f,temp_val.f); //??e dew_point
                           temp=temp_val.f*10;
                     humi=humi_val.f*10;
                     //GotoXY(5,0);                                                        //????????
                      wendu[0]=temp/1000+'0';                     //????
                      wendu[1]=temp%1000/100+'0';             //????       
                           wendu[2]=temp%100/10+'0';                        //????
                      wendu[3]=0x2E;                                                //???
                           wendu[4]=temp%10+'0';                                //?????????               
                        //Print(wendu);                                                //????       
                                lcd_string(0,5,wendu);
           //         GotoXY(5,1);                                                 
                        shidu[0]=humi/1000+'0';                     //????
                      shidu[1]=humi%1000/100+'0';             //????       
                           shidu[2]=humi%100/10+'0';                        //????
                      shidu[3]=0x2E;                                                //???
                           shidu[4]=humi%10+'0';                                //?????????       
                                //Print(shidu);                                        //????       
                        lcd_string(1,5,shidu);                               
            }  
                delay(800);                             //????????,????????                    
        }
}

/*2015-11-15*/

#ifndef __TOU_H__
#define __TOU_H__

#include
#include
//#include     //Keil library

sbit d=P1^5;
#define uint unsigned int
#define uchar unsigned char
enum {TEMP,HUMI};

sbit DATA = P1^1;
sbit SCK = P1^0;

sbit lcdrs=P0^0;                                                  
sbit lcdrw=P0^1;                                                   
sbit lcden=P0^2;
#define lcd_date P0
#define delay5us(){_nop_();_nop_();_nop_();_nop_();_nop_();}


/********     SHT10????      ********/
void s_connectionreset(void);
char s_measure(unsigned char *p_value, unsigned char *p_checksum, unsigned char mode);
void calc_sth10(float *p_humidity ,float *p_temperature);
//float calc_dewpoint(float h,float t);


#endif
/***********************************************************************************************************************************************************/

//SHT10??(SHT10.c):

//#include

#define noACK 0                                //??????,??????????
#define ACK   1             //??????;
                                                        //??  ??  ?/?
#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



//?????
char s_write_byte(unsigned char value)   
{
        unsigned char i,error=0;
        for (i=0x80;i>0;i>>=1)             //???1,????
        {
                if (i&value) DATA=1;          //????????,???????
            else DATA=0;                        
            SCK=1;                          
            _nop_();_nop_();_nop_();        //??3us
            SCK=0;
        }
        DATA=1;                           //?????
        SCK=1;                           
        error=DATA;                       //??????,??????
        _nop_();_nop_();_nop_();
        SCK=0;        
        DATA=1;
        return error;                     //error=1 ????
}

//?????
char s_read_byte(unsigned char ack)
//----------------------------------------------------------------------------------
{
        unsigned char i,val=0;
        DATA=1;                           //?????
        for(i=0x80;i>0;i>>=1)             //???1,????
        {
                SCK=1;                        
            if(DATA) val=(val|i);        //????????
            SCK=0;      
        }
        DATA=!ack;                        //?????,????????;
        SCK=1;                           
        _nop_();_nop_();_nop_();          //??3us
        SCK=0;   
        _nop_();_nop_();_nop_();      
        DATA=1;                           //?????
        return val;
}

//????
void s_transstart(void)
// generates a transmission start
//       _____         ________
// DATA:      |_______|
//           ___     ___
// SCK : ___|   |___|   |______
{
           DATA=1; SCK=0;                   //??
           _nop_();
          SCK=1;
           _nop_();
           DATA=0;
           _nop_();
          SCK=0;
           _nop_();_nop_();_nop_();
           SCK=1;
           _nop_();
          DATA=1;     
          _nop_();
           SCK=0;     
}


//????
void s_connectionreset(void)
// communication reset: DATA-line=1 and at least 9 SCK cycles followed by transstart
//       _____________________________________________________         ________
// DATA:                                                      |_______|
//          _    _    _    _    _    _    _    _    _        ___     ___
// SCK : __| |__| |__| |__| |__| |__| |__| |__| |__| |______|   |___|   |______
{
        unsigned char i;
        DATA=1; SCK=0;                    //??
        for(i=0;i<9;i++)                  //DATA???,SCK????9?,??????,?????
        {
                SCK=1;
            SCK=0;
        }
        s_transstart();                   //????
}


//?????
char s_softreset(void)
// resets the sensor by a softreset
{
        unsigned char error=0;
        s_connectionreset();              //??????
        error+=s_write_byte(RESET);       //??????
        return error;                     //error=1 ????
}


char s_read_statusreg(unsigned char *p_value, unsigned char *p_checksum)
//----------------------------------------------------------------------------------
// reads the status register with checksum (8-bit)
{
        unsigned char error=0;
        s_transstart();                   //transmission start
        error=s_write_byte(STATUS_REG_R); //send command to sensor
        *p_value=s_read_byte(ACK);        //read status register (8-bit)
        *p_checksum=s_read_byte(noACK);   //read checksum (8-bit)
        return error;                     //error=1 in case of no response form the sensor
}

//??????
char s_write_statusreg(unsigned char *p_value)
// writes the status register with checksum (8-bit)
{
        unsigned char error=0;
        s_transstart();                   //transmission start
        error+=s_write_byte(STATUS_REG_W);//send command to sensor
        error+=s_write_byte(*p_value);    //send value of status register
        return error;                     //error>=1 in case of no response form the sensor
}                                                                                                                                                  

//?????
char s_measure(unsigned char *p_value, unsigned char *p_checksum, unsigned char mode)
// ??????????,???mode??????;
{
//        enum {TEMP,HUMI};                 //?????????
        unsigned error=0;
        unsigned int i;

        s_transstart();                   //????
        switch(mode)                     //??????
    {       
                case TEMP : error+=s_write_byte(MEASURE_TEMP); break;                   //????
            case HUMI : error+=s_write_byte(MEASURE_HUMI); break;                   //????
            default     : break;
        }
        for (i=0;i<65535;i++) if(DATA==0) break; //??????
        if(DATA) error+=1;                // ????????????,??????
        *(p_value) =s_read_byte(ACK);    //??????,??? (MSB)
        *(p_value+1)=s_read_byte(ACK);    //??????,??? (LSB)
        *p_checksum =s_read_byte(noACK); //read CRC???
        return error;                                         // error=1 ????
}

//?????????????
void calc_sth10(float *p_humidity ,float *p_temperature)
{
        const float C1=-4.0;              // 12????? ????
        const float C2=+0.0405;           // 12????? ????
        const float C3=-0.0000028;        // 12????? ????
        const float T1=+0.01;             // 14????? 5V??  ????
        const float T2=+0.00008;          // 14????? 5V??  ????

        float rh=*p_humidity;             // rh:      12? ??
        float t=*p_temperature;           // t:       14? ??
        float rh_lin;                     // rh_lin: ?? linear?
        float rh_true;                    // rh_true: ?? ture?
        float t_C;                        // t_C   : ?? ?

        t_C=t*0.01 - 40;                  //????
        rh_lin=C3*rh*rh + C2*rh + C1;     //?????????
        rh_true=(t_C-25)*(T1+T2*rh)+rh_lin;   //?????????????
        if(rh_true>100)rh_true=100;       //??????
        if(rh_true<0.1)rh_true=0.1;       //??????

        *p_temperature=t_C;               //??????
        *p_humidity=rh_true;              //??????
}

//????????????
/*float calc_dewpoint(float h,float t)
{
        float logEx,dew_point;
        logEx=0.66077+7.5*t/(237.3+t)+(log10(h)-2);
        dew_point = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);
        return dew_point;
}                                                                                           */

/***********************************************************************************************************************************************************/
//DS1602??(1602.c):

//#include

//??????**************************************************************
void delayms(uchar x)
{
        uchar t;
        while(x--)
    for(t=0;t<120;t++);
}

//??????
void lcd_busy_wait()
{
uchar Hi,Lo;
        do
        {
                lcd_date |=0xf0;//4?????????????
                lcdrs=0;
                lcdrw=1;//??????? ?
                lcden=1;
                delay5us();
                Hi=lcd_date;
                delay5us();
                lcden=0;
                delay5us();
                lcden=1;
                delay5us();
                Lo=lcd_date;
                delay5us();
                lcden=0;
                delay5us();
        }
        while(Hi&0x80);
}

//???
void lcd_1602_write_com(uchar com)   
{
        lcd_busy_wait();//?????
        lcd_date=com&0xf0|0x04;//?????,?????rs,rw,en?????
        delay5us();
        lcden=0;
        delay5us();
        lcd_date=com<<4|0x04;//?????
        delay5us();
        lcden=0;
        delay5us();
}       

//???
void lcd_1602_write_dat(uchar dat)
{
        lcd_busy_wait();//?????
        lcd_date=dat&0xf0|0x05;//?????
        delay5us();
        lcden=0;
        delay5us();
        lcd_date=dat<<4|0x05;//?????
        delay5us();
        lcden=0;
        delay5us();
}       


//?????
void Lcd_1602_init()
{
        lcd_date=0xff;//?????????????
        lcd_date=0x24;//4???,?lcden,lcdrw,lcdrs=100(4),?????????
        lcden=0;//?????????

        lcd_1602_write_com(0x28); //4?,2?,5x7??          
          delayms(15);                          
          lcd_1602_write_com(0x0c); //???
        delayms(15);
        lcd_1602_write_com(0x06);  //?????,????
        delayms(15);          
          lcd_1602_write_com(0x01);//??
        delayms(15);
        lcd_1602_write_com(0x02);//????????
        delayms(15);
}       


void lcd_string(uchar r,uchar c,char *str)
{
        uchar i=0;
        code uchar ddram[]={0x80,0xc0};//???????????
         lcd_1602_write_com(ddram[r]|c);//????????
        //?????
        for(i=0;i<16&&str!= '\0';i++)
                {
                        lcd_1602_write_dat(str);
                }
}
/*
void GotoXY(unsigned char x, unsigned char y)
{
    if(y==0)
        lcd_1602_write_com(0,0x80|x);
    if(y==1)
        lcd_1602_write_com(0,0x80|(x-0x40));
}

//??????????
void Print(unsigned char *str)
{
    while(*str!='\0')
    {
      lcd_1602_write_dat(1,*str);
        str++;
    }
}
*/
/***********************************************************************************************************************************************************/
//???(main.c):

//#include

typedef union                                 //???????
{        
        unsigned int i;
        float f;
} value;

//????
void delay(int z)                //z????
{
        int x,y;
        for(x=z;x>0;x--)
                for(y=125;y>0;y--);
}


void main()
{
        unsigned int temp,humi;
        value humi_val,temp_val;                //???????,??????,??????
//        float dew_point;                            //???????
        unsigned char error;                    //??????????
        unsigned char checksum;                        //CRC                         
        uchar wendu[6];                                         //??????
        uchar shidu[6];                                         //??????
       
                                         
        Lcd_1602_init();                                           //?????                  
                   //GotoXY(0,0);                                           //????????
           //Print("TEMP:     %C");                           //5???
    //GotoXY(0,1);                                           //????????
           //Print("HUMI:     %RH");                           //5???
                lcd_string(0,0,"TEMP:     %C");
                delayms(50);
                lcd_string(1,0,"HUMI:     %RH");
        s_connectionreset();                           //??????

        while(1)
        {
                error=0;                                           //???error=0,?????
                error+=s_measure((unsigned char*)&temp_val.i,&checksum,TEMP); //????
                error+=s_measure((unsigned char*)&humi_val.i,&checksum,HUMI); //????
            if(error!=0){ s_connectionreset();   
        //d=0;
                                }
            else
            {
                                        d=0;
                        humi_val.f=(float)humi_val.i;                   //??????
                     temp_val.f=(float)temp_val.i;                   //??????
                     calc_sth10(&humi_val.f,&temp_val.f);            //?????????
//                   dew_point=calc_dewpoint(humi_val.f,temp_val.f); //??e dew_point
                           temp=temp_val.f*10;
                     humi=humi_val.f*10;
                     //GotoXY(5,0);                                                        //????????
                      wendu[0]=temp/1000+'0';                     //????
                      wendu[1]=temp%1000/100+'0';             //????       
                           wendu[2]=temp%100/10+'0';                        //????
                      wendu[3]=0x2E;                                                //???
                           wendu[4]=temp%10+'0';                                //?????????               
                        //Print(wendu);                                                //????       
                                lcd_string(0,5,wendu);
           //         GotoXY(5,1);                                                 
                        shidu[0]=humi/1000+'0';                     //????
                      shidu[1]=humi%1000/100+'0';             //????       
                           shidu[2]=humi%100/10+'0';                        //????
                      shidu[3]=0x2E;                                                //???
                           shidu[4]=humi%10+'0';                                //?????????       
                                //Print(shidu);                                        //????       
                        lcd_string(1,5,shidu);                               
            }  
                delay(800);                             //????????,????????                    
        }
}


我用点亮1个灯检测了一下程序,发现只能执行到        if(error!=0){ s_connectionreset();   这一句,就一直回到复位去了,不知道是电路的错,还是程序出错了




htu.txt

8.26 KB, 下载次数: 9

最新回复

sht10  DATA线记得加5k-10k上拉电阻,不然数据会出错  详情 回复 发表于 2017-1-2 21:31
点赞 关注
 

回复
举报

1万

帖子

25

TA的资源

版主

沙发
 
显示全乱了,代码不要直接贴,要用工具栏的<>。

点评

好的,以后一定注意  详情 回复 发表于 2015-11-15 22:10
 
 

回复

304

帖子

0

TA的资源

一粒金砂(中级)

板凳
 
dcexpert 发表于 2015-11-15 20:43
显示全乱了,代码不要直接贴,要用工具栏的。

好的,以后一定注意
 
 
 

回复

14

帖子

0

TA的资源

一粒金砂(中级)

4
 
附件为我做的温湿度采集的东西,你可以参考下。

QQ图片20161224233327.png (157.89 KB, 下载次数: 0)

QQ图片20161224233327.png

QQ图片20161224233459.png (139.73 KB, 下载次数: 0)

QQ图片20161224233459.png

QQ图片20161224233710.png (165.83 KB, 下载次数: 0)

QQ图片20161224233710.png

QQ图片20161224234454.png (350.78 KB, 下载次数: 0)

QQ图片20161224234454.png

QQ图片20161224234506.png (253.41 KB, 下载次数: 0)

QQ图片20161224234506.png

环境温湿度采集系统.pdf

540.31 KB, 下载次数: 38

点评

好的,谢谢你,学习一下  详情 回复 发表于 2016-12-31 15:41
 
 
 

回复

304

帖子

0

TA的资源

一粒金砂(中级)

5
 
qq84395064 发表于 2016-12-25 13:44
附件为我做的温湿度采集的东西,你可以参考下。

好的,谢谢你,学习一下
 
 
 

回复

10

帖子

0

TA的资源

一粒金砂(初级)

6
 
sht10  DATA线记得加5k-10k上拉电阻,不然数据会出错
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
有奖直播:当AI遇见仿真,会有什么样的电子行业革新之路?
首场直播:Simcenter AI 赋能电子行业研发创新
直播时间:04月15日14:00-14:50

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网 5

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表