0

我从 adafruit 运行 MAX31855 热电偶示例中获得了示例。但我得到的结果如下。我的代码有问题或设置设备有问题..

请帮忙!我尝试了很长时间谷歌但找不到结果

Internal Temp = 0.00
C = 0.00
F = 32.00
Internal Temp = 0.00
C = 0.00
F = 32.00
Internal Temp = 0.00
C = 0.00
F = 32.00
Internal Temp = 0.00
C = 0.00
F = 32.00

Here is the code

/*************************************************** 
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 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_MAX31855.h>

    int thermoDO = 3;
    int thermoCS = 4;
    int thermoCLK = 5;

    Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

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

      Serial.println("MAX31855 test");
      // wait for MAX chip to stabilize
      delay(500);
    }

    void loop() {
      // basic readout test, just print the current temp
       Serial.print("Internal Temp = ");
       Serial.println(thermocouple.readInternal());

       double c = thermocouple.readCelsius();
       if (isnan(c)) {
         Serial.println("Something wrong with thermocouple!");
       } else {
         Serial.print("C = "); 
         Serial.println(c);
       }
       Serial.print("F = ");
       Serial.println(thermocouple.readFarenheit());



delay(1000);
}
4

1 回答 1

0

只是一些想法,显然它并没有在您的房间里结冰,但是热电偶确实返回了 0C 和 32F 之间的正确关系,您无需进行任何数据转换。

那么,热电偶是否有一个物理参考点或结点,必须与热电偶设备本身连接到某个地方?

文档是否说当出现某种类型的错误时它总是返回 0C/32F?

最后,您的 SPI 引脚是否正确?请记住,Arduino 上有用于 SPI 的特定引脚,您在使用这些引脚吗?

于 2013-10-19T06:24:05.510 回答