91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-22
  • 語言: 其他
  • 標(biāo)簽: STM32??

資源簡介

SHT11 溫濕度傳感器 STM32驅(qū)動 SHT11 溫濕度傳感器 STM32驅(qū)動

資源截圖

代碼片段和文件信息


////////////////////////////////////////////////////////////////////////////////////////
//Code?for?reading?the?SHT11?temeprature?and?humidity?sensor?with?an?STM?ARM?CORTEX-M3?MCU?
////////////////////////////////////////////////////////////////////////////////////////
/*

The?function?read_temperature_and_humidity()?reads?the?temperature?and?humidity?and?stores?the?data?in?XX.XX?format

*/
////////////////////////////////////////////////////////////////////////////////////////
char?temperature[15];
char?humidity[15];

void?mikrosekund(int?cas);



#ifndef?SHT1X_H
#define?SHT1X_H

/*
***********************************************************************************************
* PORT?DEFINITION
***********************************************************************************************
*/

//used?pins:
//PA0?-DATA
//PA1?-SCK

#define?DATA_WR GPIOA?GPIO_Pin_0
#define DATA_RD??? GPIO_ReadInputDataBit(GPIOAGPIO_Pin_0)
#define SCK??? GPIOA?GPIO_Pin_1 ?



void?datain(void)
{?GPIO_InitTypeDef?GPIO_InitStructure;
??GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_0;
??GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IN_FLOATING;
??GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz;
??GPIO_Init(GPIOA?&GPIO_InitStructure);


}


void?dataout(void)
{?GPIO_InitTypeDef?GPIO_InitStructure;
?GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_0;
?GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_Out_PP;
?GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_2MHz;
?GPIO_Init(GPIOA?&GPIO_InitStructure);


}


void?sckout(void)
{GPIO_InitTypeDef?GPIO_InitStructure;
?GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_1;
?GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_Out_PP;
?GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_2MHz;
?GPIO_Init(GPIOA?&GPIO_InitStructure);



}


/*
***********************************************************************************************
* GLOBAL?CONSTANTS
***********************************************************************************************
*/

enum?{TEMPHUMI};

/*
***********************************************************************************************
* FUNCTION?PROTOTYPES
***********************************************************************************************
*/
char?s_softreset(void);
char?s_measure(unsigned?char?*p_value?unsigned?char?*p_checksum?unsigned?char?mode);
//char?s_write_statusreg(unsigned?char?*p_value);
//char?s_read_statusreg(unsigned?char?*p_value?unsigned?char?*p_checksum);

/*
***********************************************************************************************
* FUNCTION?PROTOTYPES
* ?HARDWARE?SPECIFIC
***********************************************************************************************
*/

void?s_transstart(void);
void?s_connectionreset(void);
char?s_read_byte(unsigned?char?ack);
char?s_write_byte(unsigned?char?value);
#endif




/*
*******************************************

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????13764??2010-11-18?20:29??sht11.c

-----------?---------??----------?-----??----

????????????????13764????????????????????1


評論

共有 條評論