前言
本次介绍的项目是 基于STM32的人体红外测温枪的设计,大家参考可用于课程实验
或 毕业设计
,希望对各位有所帮助!喜欢的小伙伴们可以加我企鹅:970484728 互相学习,有任何问题欢迎来讨论!
一、清单
二、实现功能
1. 每当按下S2按键温度阈值 加0.1,按下S3按键温度阈值 减0.1。
2. 当红外测温传感器测得人体温度大于设定温度阈值,则红色LED亮和蜂鸣器响。
3. 测得温度大于温度阈值时,此时LOED第四行显示“温度超过阈值”,否则第四行不显示任何消息。
三、部分程序
读取温度程序
u16 SMBus_ReadMemory(u8 slaveAddress, u8 command)
{
u16 data; // Data storage (DataH:DataL)
u8 Pec; // PEC byte storage
u8 DataL=0; // Low data byte storage
u8 DataH=0; // High data byte storage
u8 arr[6]; // Buffer for the sent bytes
u8 PecReg; // Calculated PEC byte storage
u8 ErrorCounter; // Defines the number of the attempts for communication with MLX90614
ErrorCounter=0x00; // Initialising of ErrorCounter
slaveAddress <<= 1; //2-7位表示从机地址 从机地址左移一位,把读写位空出来<