资讯详情

湿度传感器SHT21示例代码-SampleCodeforSHT21.PDF

湿度传感器SHT21示例代码-SampleCodeforSHT21.PDF

Sample Code for SHT21

Supporting Communication Software

Preface

This sample code is made to communicate with SHT2x CRC checksum control, set resolution, read serial

humidity and temperature sensors. The purpose of the number, low battery indication and soft-reset. This sample

code is to ease the own software programming code may be also applied on EK-H4 – and with debugging

addressing SHT21 sensors. This sample code has been hard and software it may be modified and adapted.

completed and besides the pure measurement it provides

1 Structure and Hierarchy of Code

The sample code is structured in various procedures. The relationship among the procedures is given in Figure 1.

Main program

main.c

Display modul Sensor modul (SHT2x) System modul (global)

DisplayDip204.h DisplayDip204.c SHT2x .h SHT2x .c system.h system.c

I2C Hardware abstraction

typedefs.h

I2C_HAL.h I2C_ HAL.c

Figure 1 Structure of sample code for SHT2x.

2 Sample Code

2.1 Main.c

//==============================================================================

// S E N S I R I O N AG, Laubisruetistr. 50, CH-8712 Staefa, Switzerland

//==============================================================================

// Project : SHT2x Sample Code (V1.2)

// File : main.c

// Author : MST

// Controller: NEC V850/SG3 (uPD70F3740)

// Compiler : IAR compiler for V850 (3.50A)

// Brief : This code is an example how to implement basi

标签: sht3x传感器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台