资源简介
使用Arduino采集MLX90614温度
代码片段和文件信息
/***************************************************
This is a library for the MLX90614 Temp Sensor
Designed specifically to work with the MLX90614 sensors in the
adafruit shop
----> https://www.adafruit.com/products/1748
----> https://www.adafruit.com/products/1749
These sensors use I2C to communicate 2 pins are required to
interface
Adafruit invests time and resources providing this open source code
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license all text above must be included in any redistribution
****************************************************/
#include “Adafruit_MLX90614.h“
Adafruit_MLX90614::Adafruit_MLX90614(uint8_t i2caddr) {
_addr = i2caddr;
}
boolean Adafruit_MLX90614::begin(void) {
Wire.begin();
/*
for (uint8_t i=0; i<0x20; i++) {
Serial.print(i); Serial.print(“ = “);
Serial.println(read16(i) HEX);
}
*/
return true;
}
//////////////////////////////////////////////////////
double Adafruit_MLX90614::readobjectTempF(void) {
return (readTemp(MLX90614_TOBJ1) * 9 / 5) + 32;
}
double Adafruit_MLX90614::readAmbientTempF(void) {
return (readTemp(MLX90614_TA) * 9 / 5) + 32;
}
double Adafruit_MLX90614::readobjectTempC(void) {
return readTemp(MLX90614_TOBJ1);
}
double Adafruit_MLX90614::readAmbientTempC(void) {
return readTemp(MLX90614_TA);
}
float Adafruit_MLX90614::readTemp(uint8_t reg) {
float temp;
temp = read16(reg);
temp *= .02;
temp -= 273.15;
return temp;
}
/*********************************************************************/
uint16_t Adafruit_MLX90614::read16(uint8_t a) {
uint16_t ret;
Wire.beginTransmission(_addr); // start transmission to device
Wire.write(a); // sends register address to read from
Wire.endTransmission(false); // end transmission
Wire.requestFrom(_addr (uint8_t)3);// send data n-bytes read
ret = Wire.read(); // receive DATA
ret |= Wire.read() << 8; // receive DATA
uint8_t pec = Wire.read();
return ret;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2103 2014-02-28 14:24 MLX90614\Adafruit_MLX90614.cpp
文件 1647 2014-02-28 14:24 MLX90614\Adafruit_MLX90614.h
文件 1288 2014-02-28 14:24 MLX90614\examples\mlxtest\mlxtest.ino
文件 1041 2014-02-28 14:24 MLX90614\README.txt
目录 0 2014-12-04 08:27 MLX90614\examples\mlxtest
目录 0 2014-12-04 08:27 MLX90614\examples
目录 0 2014-12-04 08:27 MLX90614
----------- --------- ---------- ----- ----
6079 7
- 上一篇:vscode作为编辑器开发stm32f103c8
- 下一篇:串口实验(接收与发送)
相关资源
- Arduino 敲琴MIDI电子琴 程序报告.docx
- 基于arduino的红绿灯程序,包附原理图
- arduino I2C设备扫描并串口返回地址(
- Arduino程序(.ino)
- Arduino-LM35-LCD1602数字温度计实验.doc
- arduino 代码
- Arduino编程从零开始.pdf
- c++操作ch340 发送串口给arduino
- Arduino+Proteus仿真 100个案例资源包.ra
- Arduino小车的程序c++/c可以实现红外对
- Arduino开源智能家居DIY,网关教程(
- OneNET平台EDP协议C语言SDK
- dht11.h库文件
- arduino GCode_Interpreterdc G代码解释器 也
- ADXL345 加速度计 arduino代码
- arduino循迹小车
- 《爱上Arduino(第3版)》pdf 高清版
- arduino library for proteus
- arduino读取温湿度传感器程序
- Arduino从基础到实践
- ARDUINO一试就上手.第2版
- mlx90614(IR_Thermometer_Sensor_MLX90614)
- MLX90614红外测温传感器源码 单片机源
- Gravity: BMI160 6轴惯性运动传 感器
- arduino学习笔记.doc(212页)
- arduino 舵机控制 串口通信 超声波传感
- 《Arduino程序设计基础》(第2版)带目
- arduino看门狗
- Arduino程序设计基础
评论
共有 条评论