sht21 c语言程序,湿度传感器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
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)