cpuTemperature()

[Analog I/O]

描述

Read the temperature of the 86Duino’s CPU. This function is available from 86Duino Coding 102.

語法

cpuTemperature(mode)
cpuTemperature()

參數

modeDEGREE_C to read the temperature in celsius (°C), or DEGREE_F to read the temperature in fahrenheit (°F). The default is DEGREE_C.

回傳

the CPU temperature (double)

Example Code

double val1 = 0.0;
double val2 = 0.0; 
 
void setup()
{
  Serial.begin(9600);
}
  
void loop()
{
  val1 = cpuTemperature(DEGREE_C);
  val2 = cpuTemperature(DEGREE_F);
  Serial.print(val1);            
  Serial.print("   ");           
  Serial.println(val2);            
  delay(100);
}

語法參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール