Arduino温度传感器值过高 [英] Arduino temperature sensor value is too high

查看:29
本文介绍了Arduino温度传感器值过高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行这段代码时,我只得到如下图所示的高温.

When I run this code, I only get a high temperature as shown in the following picture.

如何连接引脚才能正常工作?

How do I connect the pins to work properly?

A0-SIM

A1-RST

你能这样解释吗?

#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
  Serial.begin(9600);

  Serial.println("Adafruit MLX90614 test");  

  mlx.begin();  
}

void loop() {
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); 
  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF()); 
  Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");

  Serial.println();
  delay(500);

在此处输入图片描述

在此处输入图片描述

推荐答案

您的传感器使用串行通信接口,而 Adafruit 库使用 I2C 接口.所以你不能使用那个库.

Your sensor is using Serial communication interface, while Adafruit library is using I2C interface. So you can't use that library.

您需要将 Tx 连接到 Arduino Uno 上的 Pin 10,并将 Rx 连接到 Pin 11,然后运行草图显示 这里.

You need to connect Tx to Pin 10 on Arduino Uno, and Rx to Pin 11, and run the sketch shows here.

这篇关于Arduino温度传感器值过高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆