0

有人可以在这里帮助我了解 arduino 库变量名称,例如 tempTC、tempCJC、faultOpen、faultShortGND、faultShortVCC、

我感到很困惑。请在这里帮忙!谢谢

/* 读取_MAX31855.ino

TODO:
        Clean up code and comment!!
        Also make use of all library functions and make more robust.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
http://creativecommons.org/licenses/by-sa/3.0/
*/

#include <MAX31855.h>

// Adruino 1.0 pre-defines these variables
#if ARDUINO < 100
int SCK = 13;
int MISO = 12;
int SS = 10;
#endif
int LED = 9;

// Setup the variables we are going to use.
double tempTC, tempCJC;
bool faultOpen, faultShortGND, faultShortVCC, x;
bool temp_unit = 1; // 0 = Celsius, 1 = Fahrenheit

// Init the MAX31855 library for the chip.
MAX31855 temp(SCK, SS, MISO);

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
}

void loop() {
  x = temp.readMAX31855(&tempTC, &tempCJC, &faultOpen, &faultShortGND, &faultShortVCC, temp_unit);

    Serial.print(tempTC);
    Serial.print("\t");
    Serial.print(tempCJC);
    Serial.print("\t");
    Serial.print(faultOpen);
    Serial.print(faultShortGND);
    Serial.println(faultShortVCC);

  digitalWrite(LED, HIGH);
  delay(500);
  digitalWrite(LED, LOW);
  delay(500);
}
4

1 回答 1

1
  • tempTC:从 IC 读取的热电偶值。
  • tempCJC:冷端补偿温度值。
  • faultOpen faultShortGND faultShortVCC:指示在读取温度时是否发生任何这些故障的标志。

所有这些都直接在MAX31855IC 中完成,通过您发布的库通过 SPI 读取。

于 2013-10-28T21:02:34.333 回答