变量名在arduino库中的含义

时间:2013-10-28 18:13:50

标签: variables arduino

有人可以帮我在这里了解一下arduino库变量名,比如什么是tempTC,tempCJC,faultOpen,faultShortGND,faultShortVCC,

我很困惑。请帮忙!感谢

/ *     read_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);
}

1 个答案:

答案 0 :(得分:1)

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

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